presto-main/src/main/java/io/prestosql/operator/aggregation/AbstractMinMaxAggregationFunction.java/AbstractMinMaxAggregationFunction/compareAndUpdateState
class AbstractMinMaxAggregationFunction:    private static void compareAndUpdateState(MethodHandle methodHandle, NullableBooleanState state, boolean value)
    {
        if (state.isNull()) {
            state.setNull(false);
            state.setBoolean(value);
            return;
        }
        try {
            if ((boolean) methodHandle.invokeExact(value, state.getBoolean())) {
                state.setBoolean(value);
            }
        }
        catch (Throwable t) {
            throw internalError(t);
        }
    }