code: private static Class<?> extractType(
  			MethodParameter methodParam, Type type, Class<?> source, int typeIndex, int nestingLevel, int currentLevel) {
  
  		Type resolvedType = type;
  		if (type instanceof TypeVariable && methodParam != null && methodParam.typeVariableMap != null) {
  			Type mappedType = methodParam.typeVariableMap.get(type);
  			if (mappedType != null) {
  				resolvedType = mappedType;
  			}
  		}
  		if (resolvedType instanceof ParameterizedType) {
  			return extractTypeFromParameterizedType(
  					methodParam, (ParameterizedType) resolvedType, source, typeIndex, nestingLevel, currentLevel);
  		}
  		else if (resolvedType instanceof Class) {
  			return extractTypeFromClass(methodParam, (Class) resolvedType, source, typeIndex, nestingLevel, currentLevel);
  		}
  		else {
  			return null;
  		}
  	}
docs: Extract the generic type from the given Type object.
  @param methodParam the method parameter specification
  @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</code> if none