@Test public void testHash() { int hashA = new Language("aLang").hashCode(); int hashAA = new Language("aLang").hashCode(); int hashB = new Language("BLang").hashCode(); int hashA5 = new Language("aLang", 5.0).hashCode(); int hashA6 = new Language("BLang", 6.0).hashCode(); Assert.assertEquals(hashA, hashAA); Assert.assertNotEquals(hashA, hashB); Assert.assertNotEquals(hashA, hashA5); Assert.assertNotEquals(hashB, hashA5); Assert.assertNotEquals(hashA5, hashA6); }
@Override public int hashCode() { return Objects.hash(getLang(), getConfidence()); }
Language implements Serializable { @Override public int hashCode() { return Objects.hash(getLang(), getConfidence()); } }
Language implements Serializable { @Override public int hashCode() { return Objects.hash(getLang(), getConfidence()); } Language(String lang);  Language(String lang, double confidence); }
Language implements Serializable { @Override public int hashCode() { return Objects.hash(getLang(), getConfidence()); } Language(String lang);  Language(String lang, double confidence); String getLang(); double getConfidence(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
Language implements Serializable { @Override public int hashCode() { return Objects.hash(getLang(), getConfidence()); } Language(String lang);  Language(String lang, double confidence); String getLang(); double getConfidence(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }