@Test
  public void testNotPushdown() throws Exception {
    assertEquals("leaf-1", SearchArgumentImpl.BuilderImpl.pushDownNot(leaf(1))
        .toOldString());
    assertEquals("(not leaf-1)",
        SearchArgumentImpl.BuilderImpl.pushDownNot(not(leaf(1))).toOldString());
    assertEquals("leaf-1",
        SearchArgumentImpl.BuilderImpl.pushDownNot(not(not(leaf(1))))
            .toOldString());
    assertEquals("(not leaf-1)",
        SearchArgumentImpl.BuilderImpl.pushDownNot(not(not(not(leaf(1))))).
            toOldString());
    assertEquals("(or leaf-1 (not leaf-2))",
        SearchArgumentImpl.BuilderImpl.pushDownNot(not(and(not(leaf(1)),
            leaf(2)))).toOldString());
    assertEquals("(and (not leaf-1) leaf-2)",
        SearchArgumentImpl.BuilderImpl.pushDownNot(not(or(leaf(1),
            not(leaf(2))))).toOldString());
    assertEquals("(or (or (not leaf-1) leaf-2) leaf-3)",
        SearchArgumentImpl.BuilderImpl.pushDownNot(or(not(and(leaf(1),
                not(leaf(2)))),
            not(not(leaf(3))))).toOldString());
    assertEquals("NO", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.YES))).toOldString());
    assertEquals("YES", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.NO))).toOldString());
    assertEquals("NULL", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.NULL))).toOldString());
    assertEquals("YES_NO", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.YES_NO))).toOldString());
    assertEquals("YES_NULL", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.NO_NULL))).toOldString());
    assertEquals("NO_NULL", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.YES_NULL))).toOldString());
    assertEquals("YES_NO_NULL", SearchArgumentImpl.BuilderImpl.pushDownNot(
        not(constant(TruthValue.YES_NO_NULL))).toOldString());
  }
Create a predicate leaf. This is used by another test.
ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java