### Question:
NotSpanQuery extends SpanQuery { @Override public void setLevelConstraint(final int levelConstraint) { super.setLevelConstraint(levelConstraint); this.include.setLevelConstraint(levelConstraint); this.exclude.setLevelConstraint(levelConstraint); } NotSpanQuery(SpanQuery include, SpanQuery exclude);  NotSpanQuery(SpanQuery include, SpanQuery exclude, int pre, int post);  NotSpanQuery(SpanQuery include, SpanQuery exclude, int dist); @Override void setLevelConstraint(final int levelConstraint); @Override void setNodeConstraint(final int lowerBound, final int upperBound); @Override void setAncestorPointer(final NodeQuery ancestor); SpanQuery getInclude(); SpanQuery getExclude(); int getPre(); int getPost(); @Override Weight createWeight(final IndexSearcher searcher); @Override void extractTerms(final Set<Term> terms); @Override String toString(String field); @Override Query rewrite(IndexReader reader); @Override NotSpanQuery clone(); @Override int hashCode(); @Override boolean equals(Object o);  }### 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")); NotSpanQuery not1 = new NotSpanQuery(term1, term2); not1.setLevelConstraint(3); assertEquals(3, not1.getLevelConstraint()); assertEquals(3, not1.getInclude().getLevelConstraint()); assertEquals(3, not1.getExclude().getLevelConstraint()); }