presto-main/src/main/java/io/prestosql/type/FunctionParametricType.java/FunctionParametricType/createType
class FunctionParametricType:    @Override
    public Type createType(TypeManager typeManager, List<TypeParameter> parameters)
    {
        checkArgument(parameters.size() >= 1, "Function type must have at least one parameter, got %s", parameters);
        checkArgument(
                parameters.stream().allMatch(parameter -> parameter.getKind() == ParameterKind.TYPE),
                "Expected only types as a parameters, got %s",
                parameters);
        List<Type> types = parameters.stream().map(TypeParameter::getType).collect(toList());

        return new FunctionType(types.subList(0, types.size() - 1), types.get(types.size() - 1));
    }