### Question:
BeginBlockEvent extends DocumentBuilderEvent { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof BeginBlockEvent)) { return false; } BeginBlockEvent other = (BeginBlockEvent) obj; return type == other.type; } BeginBlockEvent(BlockType type, Attributes attributes); @Override void invoke(DocumentBuilder builder); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void equals() { assertEquality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.CODE, new Attributes())); assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.BULLETED_LIST, new Attributes())); assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.PREFORMATTED, new Attributes())); }
@Test public void equals() { assertEquality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent(BlockType.CODE, new Attributes())); assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent( BlockType.BULLETED_LIST, new Attributes())); assertInequality(new BeginBlockEvent(BlockType.CODE, new Attributes()), new BeginBlockEvent( BlockType.PREFORMATTED, new Attributes())); }