docs: private static Type getAsynchronizedGenericType(Object targetObject) {
          if (targetObject instanceof java.util.Collection) {
              Class<? extends java.util.Collection> rawType = (Class<? extends Collection>) targetObject.getClass();
              Class<?> actualType = Object.class;
              if (((java.util.Collection<?>) targetObject).size() > 0) {
                  Object element = ((java.util.Collection<?>) targetObject).iterator().next();
                  actualType = element.getClass();
              }
              return new ParameterizedType() {
                  private Type actualType, rawType;
  
                  public ParameterizedType setTypes(Type actualType, Type rawType) {
                      this.actualType = actualType;
                      this.rawType = rawType;
                      return this;
                  }
  
                  @Override
                  public Type[] getActualTypeArguments() {
                      return new Type[] { actualType };
                  }
  
                  @Override
                  public Type getRawType() {
                      return rawType;
                  }
  
                  @Override
                  public Type getOwnerType() {
                      return null;
                  }
              }.setTypes(actualType, rawType);
  
          } else
              return targetObject.getClass();
      }