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