TranslationMarker extends AbstractContainerMarker { @Override public int hashCode() { return this.translationKey.hashCode(); } TranslationMarker(String translationKey);  TranslationMarker(String translationKey, Marker... references); String getTranslationKey(); @Override int hashCode(); @Override boolean equals(Object other); static final String NAME; }
@Test void testHashCode() { Marker equalsTMarker = new TranslationMarker("translation.key"); Marker otherTMarker = new TranslationMarker("translation.otherkey"); Marker otherMarker = MarkerFactory.getMarker("name"); assertEquals(equalsTMarker.hashCode(), this.marker.hashCode()); assertFalse(this.marker.hashCode() == otherTMarker.hashCode()); assertFalse(this.marker.hashCode() == otherMarker.hashCode()); }