public static <T> Map<String, T> readMap(@NotNull JsonReaderEx reader, @Nullable ObjectFactory<? extends T> factory) {
    if (reader.peek() == JsonToken.NULL) {
      reader.skipValue();
      return null;
    }

    reader.beginObject();
    if (!reader.hasNext()) {
      reader.endObject();
      return Collections.emptyMap();
    }

    Map<String, T> map = new HashMap<>();
    while (reader.hasNext()) {
      if (factory == null) {
        //noinspection unchecked
        map.put(reader.nextName(), (T)read(reader));
      }
      else {
        map.put(reader.nextName(), factory.read(reader));
      }
    }
    reader.endObject();
    return map;
  }
public static <T> Map<String, T> readMap(@NotNull JsonReaderEx reader, @Nullable ObjectFactory<? extends T> factory)