presto-main/src/main/java/io/prestosql/operator/aggregation/state/KeyValuePairStateSerializer.java/KeyValuePairStateSerializer/serialize
class KeyValuePairStateSerializer:    @Override
    public void serialize(KeyValuePairsState state, BlockBuilder out)
    {
        if (state.get() == null) {
            out.appendNull();
        }
        else {
            state.get().serialize(out);
        }
    }