### Question:
NodeBooleanQuery extends NodeQuery { public void add(final NodeQuery query, final NodeBooleanClause.Occur occur) { this.add(new NodeBooleanClause(query, occur)); } NodeBooleanQuery(); static int getMaxClauseCount(); static void setMaxClauseCount(final int maxClauseCount); @Override void setLevelConstraint(final int levelConstraint); @Override void setNodeConstraint(final int lowerBound, final int upperBound); void add(final NodeQuery query, final NodeBooleanClause.Occur occur); void add(final NodeBooleanClause clause); NodeBooleanClause[] getClauses(); List<NodeBooleanClause> clauses(); final Iterator<NodeBooleanClause> iterator(); @Override Weight createWeight(final IndexSearcher searcher); @Override Query rewrite(final IndexReader reader); @Override void extractTerms(final Set<Term> terms); @Override @SuppressWarnings("unchecked") Query clone(); @Override String toString(final String field); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testEquality() throws Exception { final NodeBooleanQuery bq1 = new NodeBooleanQuery(); bq1.add(new NodeTermQuery(new Term("field", "value1")), NodeBooleanClause.Occur.SHOULD); bq1.add(new NodeTermQuery(new Term("field", "value2")), NodeBooleanClause.Occur.SHOULD); final NodeBooleanQuery bq2 = new NodeBooleanQuery(); bq2.add(new NodeTermQuery(new Term("field", "value1")), NodeBooleanClause.Occur.SHOULD); bq2.add(new NodeTermQuery(new Term("field", "value2")), NodeBooleanClause.Occur.SHOULD); assertEquals(bq2, bq1); }