@Test public void equals() { assertEquality(new CharactersEvent("test it"), new CharactersEvent("test it")); assertInequality(new CharactersEvent("test it"), new CharactersEvent("test it again")); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CharactersEvent)) { return false; } CharactersEvent other = (CharactersEvent) obj; return Objects.equals(other.text, text); }
CharactersEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CharactersEvent)) { return false; } CharactersEvent other = (CharactersEvent) obj; return Objects.equals(other.text, text); } }
CharactersEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CharactersEvent)) { return false; } CharactersEvent other = (CharactersEvent) obj; return Objects.equals(other.text, text); } CharactersEvent(String text); }
CharactersEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CharactersEvent)) { return false; } CharactersEvent other = (CharactersEvent) obj; return Objects.equals(other.text, text); } CharactersEvent(String text); @Override void invoke(DocumentBuilder builder); String getText(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
CharactersEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CharactersEvent)) { return false; } CharactersEvent other = (CharactersEvent) obj; return Objects.equals(other.text, text); } CharactersEvent(String text); @Override void invoke(DocumentBuilder builder); String getText(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }