final java.util.Set<HKEY> keys = new TreeSet<HKEY>(nonEmptyHistograms.get(0).comparator()); for (final Histogram<HKEY> histo : nonEmptyHistograms) { if (histo != null) keys.addAll(histo.keySet());
final java.util.Set<HKEY> keys = new TreeSet<HKEY>(nonEmptyHistograms.get(0).comparator()); for (final Histogram<HKEY> histo : nonEmptyHistograms) { if (histo != null) keys.addAll(histo.keySet());
final java.util.Set<HKEY> keys = new TreeSet<HKEY>(nonEmptyHistograms.get(0).comparator()); for (final Histogram<HKEY> histo : nonEmptyHistograms) { if (histo != null) keys.addAll(histo.keySet());
@Test public void testComparator() { final int[] is = {4,4,5,5,5}; final Histogram<Integer> histo1 = new Histogram<>(); for (final int i : is) histo1.increment(i); Assert.assertNull(histo1.comparator()); final Histogram<Integer> histo2 = new Histogram<>(Comparator.comparingInt(Integer::intValue)); Comparator<Integer> comp = (Comparator<Integer>) histo2.comparator(); Assert.assertNotNull(comp); Assert.assertEquals(comp.compare(4,5), -1); }