Frequency { public static Frequency of(FrequencySource source, float value) { return new Frequency(source, value); } private  Frequency(FrequencySource source, float value); static Frequency of(FrequencySource source, float value); float getFrequency(); FrequencySource getSource(); boolean isOverThreshold(float threshold); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }
@Test public void testNotEqualToOtherFrequencyOfDifferentSource() { Frequency other = Frequency.of(UNKNOWN, 1.0f); Frequency instance = Frequency.of(ESP_AFRICAN_AMERICAN, 1.0f); assertThat(instance, not(equalTo(other))); }
@Test public void testEqualToOtherFrequencyOfSameSourceAndFrequecy() { Frequency other = Frequency.of(UNKNOWN, 1.0f); Frequency instance = Frequency.of(UNKNOWN, 1.0f); assertThat(instance, equalTo(other)); }