code: private Object ensureValueCorrectness(T key, Object value) {
          checkKey(key);
          if (key.isCorrectValue(value) || value == null) {
              return value;
          }
          if (value instanceof String) {
              value = key.parseValue(String.class.cast(value));
              return value;
          }
          throw new IllegalArgumentException("Entry <'"+key+"','"+value+"'> rejected! Value should be of correct type or of type String(for auto-parsing)!");
      }
docs: Ensure that value is of correct type for the given key.
  If value is not already of correct type but of type String, attempt parsing into correct type.
  @return provided value if it's correctly typed or parsed value of correct type or {@code null} if auto-conversion failed.
  @throws IllegalArgumentException if the given key is {@code null} or if value is neither of correct type nor of String type.