code: static <T extends ValueMap> T createValueMap(Map map, Class<T> clazz) {
      try {
        Constructor<T> constructor = clazz.getDeclaredConstructor(Map.class);
        constructor.setAccessible(true);
        return constructor.newInstance(map);
      } catch (Exception e) {
        throw new AssertionError(
            "Could not create instance of " + clazz.getCanonicalName() + ".\n" + e);
      }
    }
docs: Uses reflection to create an instance of a subclass of {@link ValueMap}. The subclass
  <b>must</b> declare a map constructor.