### Question:
LuceneProxyNodeScorer extends Scorer { @Override public int nextDoc() throws IOException { while (scorer.nextCandidateDocument()) { if (scorer.nextNode()) { return this.docID(); } } return NO_MORE_DOCS; } LuceneProxyNodeScorer(final NodeScorer scorer); @Override void score(final Collector collector); @Override boolean score(final Collector collector, final int max, final int firstDocID); @Override int docID(); @Override int advance(final int target); @Override int nextDoc(); @Override float score(); @Override float freq(); @Override Collection<ChildScorer> getChildren();  }### Answer:
@Test public void testNextDoc() throws Exception { this.addDocuments( "{ \"aaa bbb\" : \"aaa ccc\" , \"ccc\" \"bbb ccc\" }", "{ \"aaa\" : \"aaa bbb ddd\" }" ); final Scorer scorer1 = this.getScorer( ntq("aaa").getLuceneProxyQuery() ); assertTrue(scorer1.nextDoc() != DocIdSetIterator.NO_MORE_DOCS); assertEquals(0, scorer1.docID()); assertEquals(2, scorer1.freq(), 0); assertTrue(scorer1.nextDoc() != DocIdSetIterator.NO_MORE_DOCS); assertEquals(1, scorer1.docID()); assertEquals(2, scorer1.freq(), 0); assertTrue(scorer1.nextDoc() == DocIdSetIterator.NO_MORE_DOCS); final Scorer scorer2 = this.getScorer( ntq("ccc").getLuceneProxyQuery() ); assertTrue(scorer2.nextDoc() != DocIdSetIterator.NO_MORE_DOCS); assertEquals(0, scorer2.docID()); assertEquals(3, scorer2.freq(), 0); assertTrue(scorer2.nextDoc() == DocIdSetIterator.NO_MORE_DOCS); final Scorer scorer3 = this.getScorer( ntq("ddd").getLuceneProxyQuery() ); assertTrue(scorer3.nextDoc() != DocIdSetIterator.NO_MORE_DOCS); assertEquals(1, scorer3.docID()); assertEquals(1, scorer3.freq(), 0); assertTrue(scorer3.nextDoc() == DocIdSetIterator.NO_MORE_DOCS); }