public Predicate toPredicate() {
      if (outer != null) {
        throw new IllegalStateException("Unbalanced block - missing end.");
      }
      done = true;
      return getPredicate();
    }
Allow for chaining of already constructed predicates
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java