code: private static Class<?> extractType(Type type, Class<?> source, int typeIndex,
  			Map<TypeVariable, Type> typeVariableMap, Map<Integer, Integer> typeIndexesPerLevel,
  			int nestingLevel, int currentLevel) {
  
  		Type resolvedType = type;
  		if (type instanceof TypeVariable && typeVariableMap != null) {
  			Type mappedType = typeVariableMap.get(type);
  			if (mappedType != null) {
  				resolvedType = mappedType;
  			}
  		}
  		if (resolvedType instanceof ParameterizedType) {
  			return extractTypeFromParameterizedType((ParameterizedType) resolvedType, source, typeIndex, typeVariableMap, typeIndexesPerLevel,
  					nestingLevel, currentLevel);
  		}
  		else if (resolvedType instanceof Class) {
  			return extractTypeFromClass((Class) resolvedType, source, typeIndex, typeVariableMap, typeIndexesPerLevel,
  					nestingLevel, currentLevel);
  		}
  		else if (resolvedType instanceof GenericArrayType) {
  			Type compType = ((GenericArrayType) resolvedType).getGenericComponentType();
  			return extractType(compType, source, typeIndex, typeVariableMap, typeIndexesPerLevel, nestingLevel, currentLevel + 1);
  		}
  		else {
  			return null;
  		}
  	}
docs: Extract the generic type from the given Type object.
  @param type the Type to check
  @param source the source collection/map Class that we check
  @param typeIndex the index of the actual type argument
  @param nestingLevel the nesting level of the target type
  @param currentLevel the current nested level
  @return the generic type as Class, or {@code null} if none