### Question:
OrSpanQuery extends SpanQuery implements Cloneable { @Override public void setLevelConstraint(final int levelConstraint) { super.setLevelConstraint(levelConstraint); for (SpanQuery clause : clauses) { clause.setLevelConstraint(levelConstraint); } } OrSpanQuery();  OrSpanQuery(final SpanQuery... clauses); @Override void setLevelConstraint(final int levelConstraint); @Override void setNodeConstraint(final int lowerBound, final int upperBound); @Override void setAncestorPointer(final NodeQuery ancestor); final void addClause(SpanQuery clause); SpanQuery[] getClauses(); @Override Weight createWeight(final IndexSearcher searcher); @Override void extractTerms(final Set<Term> terms); @Override String toString(final String field); @Override OrSpanQuery clone(); @Override Query rewrite(final IndexReader reader); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testSetLevelConstraint() { TermSpanQuery term1 = new TermSpanQuery(new Term(DEFAULT_TEST_FIELD, "aaa")); TermSpanQuery term2 = new TermSpanQuery(new Term(DEFAULT_TEST_FIELD, "bbb")); OrSpanQuery or1 = new OrSpanQuery(new SpanQuery[] {term1, term2}); or1.setLevelConstraint(3); assertEquals(3, or1.getLevelConstraint()); assertEquals(3, or1.getClauses()[0].getLevelConstraint()); assertEquals(3, or1.getClauses()[1].getLevelConstraint()); NodeSpanQuery term3 = new NodeSpanQuery(ntq("aaa").getQuery()); NodeSpanQuery term4 = new NodeSpanQuery(ntq("bbb").getQuery()); OrSpanQuery or2 = new OrSpanQuery(new SpanQuery[] {term3, term4}); or2.setLevelConstraint(4); OrSpanQuery or3 = new OrSpanQuery(new SpanQuery[] {or1, or2}); or3.setLevelConstraint(6); assertEquals(6, or1.getLevelConstraint()); assertEquals(6, or2.getLevelConstraint()); }