### Question:
RollbackRule implements Serializable { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof RollbackRule)) { return false; } RollbackRule rhs = (RollbackRule) other; return this.exceptionName.equals(rhs.exceptionName); } RollbackRule(String exceptionName);  RollbackRule(Class<?> clazz); String getExceptionName(); int getDepth(Throwable ex); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void equalsTest(){ RollbackRule otherRollbackRuleByName = new RollbackRule(Exception.class.getName()); RollbackRule otherRollbackRuleByName2 = new NoRollbackRule(Exception.class.getName()); Assertions.assertNotEquals("", otherRollbackRuleByName); Assertions.assertEquals(otherRollbackRuleByName, otherRollbackRuleByName); Assertions.assertEquals(otherRollbackRuleByName, otherRollbackRuleByName2); }