presto-main/src/main/java/io/prestosql/operator/aggregation/state/TriStateBooleanStateSerializer.java/TriStateBooleanStateSerializer/serialize
class TriStateBooleanStateSerializer:    @Override
    public void serialize(TriStateBooleanState state, BlockBuilder out)
    {
        if (state.getByte() == NULL_VALUE) {
            out.appendNull();
        }
        else {
            out.writeByte(state.getByte() == TRUE_VALUE ? 1 : 0).closeEntry();
        }
    }