SingleDocIdFilter extends Query { @Override public boolean equals(Object obj) { return super.equals(obj) && luceneDocId == ((SingleDocIdFilter)obj).luceneDocId; } SingleDocIdFilter(int luceneDocId); @Override Weight createWeight(IndexSearcher searcher, boolean needsScores); @Override String toString(String field); @Override boolean equals(Object obj);  }
@Test public void testEquals() { SingleDocIdFilter singleDocIdFilter = new SingleDocIdFilter(1); SingleDocIdFilter singleDocIdFilter2 = new SingleDocIdFilter(2); Assert.assertNotEquals(singleDocIdFilter,singleDocIdFilter2); }