### Question:
LuceneProxyNodeQuery extends Query { @Override public void setBoost(final float b) { nodeQuery.setBoost(b); } LuceneProxyNodeQuery(final NodeQuery nq); @Override Weight createWeight(final IndexSearcher searcher); @Override Query rewrite(final IndexReader reader); @Override void extractTerms(final Set<Term> terms); @Override String toString(final String field); @Override boolean equals(final Object o); @Override int hashCode(); NodeQuery getNodeQuery(); @Override void setBoost(final float b);  }### Answer:
@Test public void testBoost() throws Exception { final float boost = 2.5f; this.addDocument("\"aaa ccc\" \"one five\" . \"aaa bbb\" \"ccc eee\" ."); BooleanQuery bq1 = new BooleanQuery(); NodeTermQuery tq = new NodeTermQuery(new Term (DEFAULT_TEST_FIELD, "one")); tq.setBoost(boost); bq1.add(new LuceneProxyNodeQuery(tq), Occur.MUST); bq1.add(new LuceneProxyNodeQuery(new NodeTermQuery(new Term (DEFAULT_TEST_FIELD, "five"))), Occur.MUST); BooleanQuery bq2 = new BooleanQuery(); tq = new NodeTermQuery(new Term (DEFAULT_TEST_FIELD, "one")); LuceneProxyNodeQuery dq = new LuceneProxyNodeQuery(tq); dq.setBoost(boost); bq2.add(dq, Occur.MUST); bq2.add(new LuceneProxyNodeQuery(new NodeTermQuery(new Term (DEFAULT_TEST_FIELD, "five"))), Occur.MUST); assertScoreEquals(bq1, bq2); }