@Test public void equals() { assertEquality(new AcronymEvent("one", "two"), new AcronymEvent("one", "two")); assertInequality(new AcronymEvent("one", "two"), new AcronymEvent("three", "two")); assertInequality(new AcronymEvent("one", "two"), new AcronymEvent("one", "three")); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AcronymEvent)) { return false; } AcronymEvent other = (AcronymEvent) obj; return Objects.equals(text, other.text) && Objects.equals(definition, other.definition); }
AcronymEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AcronymEvent)) { return false; } AcronymEvent other = (AcronymEvent) obj; return Objects.equals(text, other.text) && Objects.equals(definition, other.definition); } }
AcronymEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AcronymEvent)) { return false; } AcronymEvent other = (AcronymEvent) obj; return Objects.equals(text, other.text) && Objects.equals(definition, other.definition); } AcronymEvent(String text, String definition); }
AcronymEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AcronymEvent)) { return false; } AcronymEvent other = (AcronymEvent) obj; return Objects.equals(text, other.text) && Objects.equals(definition, other.definition); } AcronymEvent(String text, String definition); @Override void invoke(DocumentBuilder builder); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
AcronymEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof AcronymEvent)) { return false; } AcronymEvent other = (AcronymEvent) obj; return Objects.equals(text, other.text) && Objects.equals(definition, other.definition); } AcronymEvent(String text, String definition); @Override void invoke(DocumentBuilder builder); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }