code: public static boolean isSupportedType(final Class<?> clazz) {
          if (ReflectionUtils.isPropertyType(clazz)) {
              return true;
          }
          if (clazz.isArray() || Map.class.isAssignableFrom(clazz) || Iterable.class.isAssignableFrom(clazz)) {
              Class<?> subType;
              if (clazz.isArray()) {
                  subType = clazz.getComponentType();
              } else {
                  subType = ReflectionUtils.getParameterizedClass(clazz);
              }
  
              //get component type, String.class from List<String>
              if (subType != null && subType != Object.class && !ReflectionUtils.isPropertyType(subType)) {
                  return false;
              }
  
              //either no componentType or it is an allowed type
              return true;
          }
          return false;
      }
docs: Checks to see if it a Map/Set/List or a property supported by the MongoDB java driver
  
  @param clazz the type to check
  @return true if the type is supported