code: @SuppressWarnings("unchecked")
  	private <IN1, IN2, OUT> TypeInformation<OUT> privateCreateTypeInfo(Class<?> baseClass, Class<?> clazz, int returnParamPos,
  			TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) {
  		ArrayList<Type> typeHierarchy = new ArrayList<Type>();
  		Type returnType = getParameterType(baseClass, typeHierarchy, clazz, returnParamPos);
  
  		TypeInformation<OUT> typeInfo;
  
  		// return type is a variable -> try to get the type info from the input directly
  		if (returnType instanceof TypeVariable<?>) {
  			typeInfo = (TypeInformation<OUT>) createTypeInfoFromInputs((TypeVariable<?>) returnType, typeHierarchy, in1Type, in2Type);
  
  			if (typeInfo != null) {
  				return typeInfo;
  			}
  		}
  
  		// get info from hierarchy
  		return (TypeInformation<OUT>) createTypeInfoWithTypeHierarchy(typeHierarchy, returnType, in1Type, in2Type);
  	}
docs: for (Rich)Functions