NumEntries { @NotNull static NumEntries valueOf(long size, boolean isExact) { if (size == 0) { return ZERO; } else { return new NumEntries(size, isExact); } } private  NumEntries(long size, boolean isExact); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testValueOfExactZero() { assertSame(NumEntries.ZERO, NumEntries.valueOf(0, true)); }
@Test public void testValueOfNotExactZero() { NumEntries ne = NumEntries.valueOf(0, false); assertSame(NumEntries.ZERO, ne); }
@Test public void testValueOfExact() { NumEntries ne = NumEntries.valueOf(25, true); assertTrue(ne.isExact); assertEquals(25, ne.size); }
@Test public void testValueOfNotExact() { NumEntries ne = NumEntries.valueOf(25, false); assertFalse(ne.isExact); assertEquals(25, ne.size); }