private static void assertNoSharedNodes(ExpressionTree tree,
                                          Set<ExpressionTree> seen
  ) throws Exception {
    if (seen.contains(tree) &&
        tree.getOperator() != ExpressionTree.Operator.LEAF) {
      assertTrue("repeated node in expression " + tree, false);
    }
    seen.add(tree);
    if (tree.getChildren() != null) {
      for (ExpressionTree child : tree.getChildren()) {
        assertNoSharedNodes(child, seen);
      }
    }
  }
Create a predicate leaf. This is used by another test.
ql/src/test/org/apache/hadoop/hive/ql/io/sarg/TestSearchArgumentImpl.java