### Question:
NodeReqExclScorer extends NodeScorer { @Override public boolean skipToCandidate(final int target) throws IOException { if (exclScorer == null) { return reqScorer.skipToCandidate(target); } if (!reqScorer.skipToCandidate(target)) { return false; } return this.toNonExcludedCandidateDocument(); } NodeReqExclScorer(final NodeScorer reqScorer,
                           final NodeScorer exclScorer); @Override boolean nextCandidateDocument(); @Override boolean nextNode(); @Override int doc(); @Override IntsRef node(); @Override int freqInNode(); @Override float scoreInNode(); @Override boolean skipToCandidate(final int target); @Override String toString();  }### Answer:
@Test public void testSkipToCandidate() throws Exception { final ArrayList<String> docs = new ArrayList<String>(); for (int i = 0; i < 32; i++) { docs.add("\"aaa bbb\" \"aaa ccc\" . \"aaa bbb ccc\" \"bbb ccc\" \"aaa aaa\". "); docs.add("\"aaa bbb aaa\" . \"aaa ccc bbb\" . "); } this.addDocuments(docs); final NodeScorer scorer = this.getScorer( nbq(must("aaa"), not("bbb")) ); assertTrue(scorer.skipToCandidate(16)); assertEquals(16, scorer.doc()); assertEquals(node(-1), scorer.node()); assertTrue(scorer.nextNode()); assertEquals(node(0,1), scorer.node()); assertTrue(scorer.nextNode()); assertEquals(node(1,2), scorer.node()); assertFalse(scorer.nextNode()); assertEquals(DocsAndNodesIterator.NO_MORE_NOD, scorer.node()); assertTrue(scorer.nextCandidateDocument()); assertEquals(17, scorer.doc()); assertEquals(node(-1), scorer.node()); assertFalse(scorer.nextNode()); assertEquals(DocsAndNodesIterator.NO_MORE_NOD, scorer.node()); assertTrue(scorer.skipToCandidate(40)); assertEquals(40, scorer.doc()); assertEquals(node(-1), scorer.node()); assertTrue(scorer.nextNode()); assertEquals(node(0,1), scorer.node()); assertTrue(scorer.nextNode()); assertEquals(node(1,2), scorer.node()); assertFalse(scorer.nextNode()); assertEquals(DocsAndNodesIterator.NO_MORE_NOD, scorer.node()); assertFalse(scorer.skipToCandidate(65)); assertEndOfStream(scorer); }