docs: public static <K, V> void validateNotNull(Map<? extends K, ? extends V> map) {
          checkNotNull(map, "map is null");
  
          boolean containsNullKey = false;
          boolean containsNullValue = false;
          // we catch possible NPE since the Map implementation could not support null values
          // TODO: is it possible to validate a map more efficiently without try-catch blocks?
          try {
              containsNullKey = map.containsKey(null);
          } catch (NullPointerException e) {
              // ignore if null key is not allowed for this map
              ignore(e);
          }
          try {
              containsNullValue = map.containsValue(null);
          } catch (NullPointerException e) {
              // ignore if null value is not allowed for this map
              ignore(e);
          }
          if (containsNullKey) {
              throw new NullPointerException(NULL_KEY_IS_NOT_ALLOWED);
          }
          if (containsNullValue) {
              throw new NullPointerException(NULL_VALUE_IS_NOT_ALLOWED);
          }
      }