presto-main/src/main/java/io/prestosql/operator/scalar/MapToMapCast.java/MapToMapCast/specialize
class MapToMapCast:    @Override
    public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, Metadata metadata)
    {
        checkArgument(arity == 1, "Expected arity to be 1");
        Type fromKeyType = boundVariables.getTypeVariable("FK");
        Type fromValueType = boundVariables.getTypeVariable("FV");
        Type toKeyType = boundVariables.getTypeVariable("TK");
        Type toValueType = boundVariables.getTypeVariable("TV");
        Type toMapType = metadata.getParameterizedType(
                "map",
                ImmutableList.of(
                        TypeSignatureParameter.typeParameter(toKeyType.getTypeSignature()),
                        TypeSignatureParameter.typeParameter(toValueType.getTypeSignature())));

        MethodHandle keyProcessor = buildProcessor(metadata, fromKeyType, toKeyType, true);
        MethodHandle valueProcessor = buildProcessor(metadata, fromValueType, toValueType, false);
        MethodHandle target = MethodHandles.insertArguments(METHOD_HANDLE, 0, keyProcessor, valueProcessor, toMapType);
        return new ScalarFunctionImplementation(true, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), target);
    }