code: private static Class<?> searchIntoParameterzedType(final Type superType, final Class<?> typeSearched) {
          if (superType instanceof ParameterizedType) {
              for (final Type genericType : ((ParameterizedType) superType).getActualTypeArguments()) {
                  if (genericType instanceof Class<?> && typeSearched.isAssignableFrom((Class<?>) genericType)) {
                      return (Class<?>) genericType;
                  } else if (genericType instanceof ParameterizedType && typeSearched.isAssignableFrom((Class<?>) ((ParameterizedType) genericType).getRawType())) {
                      return (Class<?>) ((ParameterizedType) genericType).getRawType();
                  }
              }
          }
          return null;
      }
docs: Extract the searched type from a ParamterizedType.
  
  @param superType the base class hosting the generic type
  @param typeSearched the searched type, the returned class shall be a subclass of it
  
  @return the searched type or null