FrequencyDistribution implements Serializable { public void inc(T sample) { addSample(sample, 1); } FrequencyDistribution();  FrequencyDistribution(Iterable<T> iterable); boolean contains(T sample); void inc(T sample); void incAll(Iterable<T> iterable); long getN(); long getB(); long getCount(T sample); @SuppressWarnings("unchecked") Set<T> getKeys(); void addSample(T sample, long number); long getMaxFreq(); T getSampleWithMaxFreq(); void save(File file); void load(File file); void clear(); List<T> getMostFrequentSamples(int n);  }
@Test public void testMaxIntHash() { String badKey = "'s_'s_not_noticed"; assertEquals(Integer.MIN_VALUE, badKey.hashCode()); FrequencyDistribution<String> fd = new FrequencyDistribution<String>(); fd.inc(badKey); }