code: public static Class<?> getGenericClassAssigned(final Class<?> fromClass, final Class<?> typeSearched) {
  
          Class<?> realType = null;
  
          final Type superType = fromClass.getGenericSuperclass();
  
          realType = searchIntoParameterzedType(superType, typeSearched);
  
          if (realType == null) {
              for (final Type api : fromClass.getGenericInterfaces()) {
                  realType = searchIntoParameterzedType(api, typeSearched);
              }
          }
  
          if (realType == null && superType instanceof Class<?>) {
              realType = getGenericClassAssigned((Class<?>) superType, typeSearched);
          }
  
          if (realType == null) {
              for (final Type api : fromClass.getGenericInterfaces()) {
                  if (api instanceof Class<?>) {
                      realType = getGenericClassAssigned((Class<?>) api, typeSearched);
                  }
              }
          }
  
          return realType;
      }
docs: Return the first generic type of the hierarchy that can be assigned to the type searched.
  
  @param fromClass the base class hosting the generic type
  @param typeSearched the searched type, the returned class shall be a subclass of it
  
  @return a class that is a subclass of typeSearched or null