@Test public void testHash() { int hashA = new LanguageSample(new Language("aLang"), "aContext").hashCode(); int hashB = new LanguageSample(new Language("bLang"), "aContext").hashCode(); int hashC = new LanguageSample(new Language("aLang"), "bContext").hashCode(); Assert.assertNotEquals(hashA, hashB); Assert.assertNotEquals(hashA, hashC); Assert.assertNotEquals(hashB, hashC); }
@Override public int hashCode() { return Objects.hash(getContext(), getLanguage()); }
LanguageSample implements Serializable { @Override public int hashCode() { return Objects.hash(getContext(), getLanguage()); } }
LanguageSample implements Serializable { @Override public int hashCode() { return Objects.hash(getContext(), getLanguage()); } LanguageSample(Language language, CharSequence context); }
LanguageSample implements Serializable { @Override public int hashCode() { return Objects.hash(getContext(), getLanguage()); } LanguageSample(Language language, CharSequence context); Language getLanguage(); CharSequence getContext(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
LanguageSample implements Serializable { @Override public int hashCode() { return Objects.hash(getContext(), getLanguage()); } LanguageSample(Language language, CharSequence context); Language getLanguage(); CharSequence getContext(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }