code: private <T extends ValueMap> T coerceToValueMap(Object object, Class<T> clazz) {
      if (object == null) return null;
      if (clazz.isAssignableFrom(object.getClass())) {
        //noinspection unchecked
        return (T) object;
      }
      if (object instanceof Map) return createValueMap((Map) object, clazz);
      return null;
    }
docs: Coerce an object to a JsonMap. It will first check if the object is already of the expected
  type. If not, it checks if the object a {@link Map} type, and feeds it to the constructor by
  reflection.