@Test
public void multipleCommunities() {

    final LongLongMap communitySizeMap = new LongLongScatterMap();
    communitySizeMap.addTo(1, 4);
    communitySizeMap.addTo(2, 10);
    communitySizeMap.addTo(3, 9);
    communitySizeMap.addTo(4, 8);
    communitySizeMap.addTo(5, 7);
    Histogram histogram = CommunityHistogram.buildFrom(communitySizeMap);
    assertEquals(10.0, histogram.getValueAtPercentile(100D), 0.01);
    assertEquals(8.0, histogram.getValueAtPercentile(50D), 0.01);
}