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