LeanHit implements Comparable<LeanHit> { public double getRelevance() { return relevance; } LeanHit(byte [] gid, int partId, int distributionKey, double relevance);  LeanHit(byte [] gid, int partId, int distributionKey, double relevance, byte [] sortData); double getRelevance(); byte [] getGid(); byte [] getSortData(); boolean hasSortData(); int getPartId(); int getDistributionKey(); @Override int compareTo(LeanHit o);  }
@Test public void testRelevanceIsKeptEvenWithBySortData() { assertEquals(1.3, new LeanHit(gidA, 0, 0, 1.3, gidA).getRelevance(), 0.0); }
@Test public void testNaN2negativeInfinity() { LeanHit nan = new LeanHit(gidA, 0, 0, Double.NaN); assertFalse(Double.isNaN(nan.getRelevance())); assertTrue(Double.isInfinite(nan.getRelevance())); assertEquals(Double.NEGATIVE_INFINITY, nan.getRelevance(), DELTA); }