NonI18NModel implements I18NModel { @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof NonI18NModel)) return false; final NonI18NModel that = (NonI18NModel) o; return value != null ? value.equals(that.value) : that.value == null; } NonI18NModel(final String value); @Override String getValue(final String locale); @Override void putValue(final String locale, final String value); @Override Map<String, String> getAllValues(); @Override I18NModel copy(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() throws Exception { final I18NModel m1 = new NonI18NModel("Some text"); final I18NModel m2 = new NonI18NModel("Some text"); assertTrue(m1.equals(m2)); assertTrue(m2.equals(m1)); assertEquals(m2.hashCode(), m1.hashCode()); final I18NModel m3 = new NonI18NModel("Some text 2"); assertFalse(m3.equals(m2)); assertFalse(m2.equals(m3)); assertNotEquals(m2.hashCode(), m3.hashCode()); }