code: private static Type mapTypeParameters(Type toMapType, Type typeAndParams)
  	{
  		if (isMissingTypeParameters(typeAndParams))
  		{
  			return erase(toMapType);
  		}
  		else
  		{
  			VarMap varMap = new VarMap();
  			Type handlingTypeAndParams = typeAndParams;
  			while (handlingTypeAndParams instanceof ParameterizedType)
  			{
  				ParameterizedType pType = (ParameterizedType) handlingTypeAndParams;
  				Class<?> clazz = (Class<?>) pType.getRawType(); // getRawType
  																// should always
  																// be Class
  				varMap.addAll(clazz.getTypeParameters(), pType.getActualTypeArguments());
  				handlingTypeAndParams = pType.getOwnerType();
  			}
  			return varMap.map(toMapType);
  		}
  	}
docs: Maps type parameters in a type to their values.
  
  @param toMapType
  Type possibly containing type arguments
  @param typeAndParams
  must be either ParameterizedType, or (in case there are no
  type arguments, or it's a raw type) Class
  @return toMapType, but with type parameters from typeAndParams replaced.