code: protected FunctionTypeReference getAsFunctionOrNull(ParameterizedTypeReference typeReference) {
  		if (typeReference.isRawType())
  			return null;
  		FunctionTypeReference functionType = new FunctionTypeReference(typeReference.getOwner(), typeReference.getType());
  		List<LightweightTypeReference> allTypeArguments = typeReference.getTypeArguments();
  		if (!tryAssignTypeArguments(allTypeArguments.subList(0, allTypeArguments.size() - 1), functionType))
  			return null;
  		LightweightTypeReference lastTypeArgument = allTypeArguments.get(allTypeArguments.size() - 1);
  		functionType.addTypeArgument(lastTypeArgument);
  		LightweightTypeReference returnType = lastTypeArgument.getUpperBoundSubstitute();
  		functionType.setReturnType(returnType);
  		return functionType;
  	}
docs: /* @Nullable