presto-main/src/main/java/io/prestosql/operator/aggregation/state/TriStateBooleanState.java/TriStateBooleanState/write
class TriStateBooleanState:    static void write(Type type, TriStateBooleanState state, BlockBuilder out)
    {
        if (state.getByte() == NULL_VALUE) {
            out.appendNull();
        }
        else {
            type.writeBoolean(out, state.getByte() == TRUE_VALUE);
        }
    }