code: private static <T> Object subDocumentListCase(Type type, List<T> jsonObject)
              throws IllegalAccessException, InstantiationException, InvocationTargetException {
          ParameterizedType listType = (ParameterizedType) type;
  
          Class<?> listClass = (Class<?>) listType.getActualTypeArguments()[0];
  
          List list = new ArrayList();
          for (T t : jsonObject) {
              list.add(getObjectFromJson(listClass, (JSONObject) t));
          }
  
          return list;
      }
docs: Sub document list case.
  
  @param <T>        the type parameter
  @param type       the type
  @param jsonObject the json object
  @return the object
  @throws IllegalAccessException    the illegal access exception
  @throws InstantiationException    the instantiation exception
  @throws InvocationTargetException the invocation target exception