presto-main/src/main/java/io/prestosql/operator/aggregation/state/NullableDoubleStateSerializer.java/NullableDoubleStateSerializer/serialize
class NullableDoubleStateSerializer:    @Override
    public void serialize(NullableDoubleState state, BlockBuilder out)
    {
        if (state.isNull()) {
            out.appendNull();
        }
        else {
            DOUBLE.writeDouble(out, state.getDouble());
        }
    }