### Question:
NodeBooleanQuery extends NodeQuery { @Override public void setLevelConstraint(final int levelConstraint) { super.setLevelConstraint(levelConstraint); for (final NodeBooleanClause clause : clauses) { clause.getQuery().setLevelConstraint(levelConstraint); } } 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 testSetLevelConstraint() { final NodeTermQuery ntq = new NodeTermQuery(new Term("field", "value")); final NodeBooleanQuery bq = new NodeBooleanQuery(); bq.add(ntq, Occur.MUST); bq.setLevelConstraint(3); assertEquals(3, bq.getLevelConstraint()); assertEquals(3, ntq.getLevelConstraint()); final NodeTermQuery ntq2 = new NodeTermQuery(new Term("field", "value")); bq.add(ntq2, Occur.MUST); assertEquals(3, ntq2.getLevelConstraint()); }