### Question:
NodePhraseQuery extends DatatypedNodeQuery { @Override public Weight createWeight(final IndexSearcher searcher) throws IOException { return new NodePhraseWeight(searcher); } NodePhraseQuery(); void add(final Term term); void add(final Term term, final int position); Term[] getTerms(); int[] getPositions(); @Override Query rewrite(final IndexReader reader); @Override Weight createWeight(final IndexSearcher searcher); @Override void extractTerms(final Set<Term> queryTerms); @Override String toString(final String f); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testExplain() throws IOException { this.addDocuments("\"Renaud Delbru\" . ", "\"Renaud Delbru\" . \"Renaud Delbru\" . "); final Query query = npq("renaud", "delbru").getLuceneProxyQuery(); final Weight w = query.createWeight(searcher); Explanation explanation = w.explain((AtomicReaderContext) reader.getContext(), 0); assertNotNull("explanation is null and it shouldn't be", explanation); explanation = w.explain((AtomicReaderContext) reader.getContext(), 1); assertNotNull("explanation is null and it shouldn't be", explanation); explanation = w.explain((AtomicReaderContext) reader.getContext(), 2); assertNotNull("explanation is null and it shouldn't be", explanation); assertEquals("term frq is not 0", 0f, explanation.getValue(), 0f); }