@Test
    @FeatureRequirement(featureClass = GraphFeatures.class, feature = GraphFeatures.FEATURE_ORDERABILITY_SEMANTICS)
    public void testNot() {
        final P TRUE = P.eq(1);
        final P FALSE = P.gt(1);
        final P ERROR = P.lt(Double.NaN);

        // TRUE -> FALSE
        checkHasNext(false, g.inject(1).not(is(TRUE)));
        // FALSE -> TRUE
        checkHasNext(true, g.inject(1).not(is(FALSE)));
        // ERROR -> ERROR -> FALSE
        checkHasNext(false, g.inject(1).not(is(ERROR)));

        // Binary reduction with NaN
        checkHasNext(false, g.inject(1).is(P.eq(Double.NaN)));
        checkHasNext(true, g.inject(1).is(P.neq(Double.NaN)));
        checkHasNext(true, g.inject(1).not(is(P.eq(Double.NaN))));
        checkHasNext(false, g.inject(1).not(not(is(P.eq(Double.NaN)))));
        checkHasNext(false, g.inject(1).where(__.inject(1).not(is(ERROR))));
    }
The NOT predicate inverts TRUE and FALSE but maintains ERROR values. For ERROR, we can neither prove
nor disprove the value expression and hence stick with ERROR.
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/TernaryBooleanLogicsTest.java