presto-main/src/main/java/io/prestosql/operator/aggregation/state/NullableBooleanState.java/NullableBooleanState/write
class NullableBooleanState:    static void write(Type type, NullableBooleanState state, BlockBuilder out)
    {
        if (state.isNull()) {
            out.appendNull();
        }
        else {
            type.writeBoolean(out, state.getBoolean());
        }
    }