### Question:
NDCG extends DiscountedCumulativeGain2002 { @Override public double score(Judgments judgments, SearchResultSet searchResultSet) { final double idealDCG = calculateIdeal(judgments, Math.min(getAtN(), searchResultSet.size()), searchResultSet.getTotalHits(), searchResultSet.getQueryTime(), searchResultSet.getElapsedTime()); if (idealDCG == 0) { return 0.0; } double score = _score(judgments, searchResultSet) / idealDCG; addScore(judgments.getQueryInfo(), score); return score; } NDCG(int atN); @Override double score(Judgments judgments, SearchResultSet searchResultSet); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testCG() { CumulativeGain cumulativeGain = new CumulativeGain(10); Assertions.assertEquals(11.0f, cumulativeGain.score(JUDGMENTS, RESULT_SET), 0.001); }
@Test public void testDCG2002() { DiscountedCumulativeGain2002 dcg2002 = new DiscountedCumulativeGain2002(10); Assertions.assertEquals(6.861, dcg2002.score(JUDGMENTS, RESULT_SET), 0.001); }