### Question:
Topic { @Override public boolean equals(Object other) { if (this == other) { return true; } if (other == null || this.getClass() != other.getClass()) { return false; } Topic otherTopic = (Topic) other; return Arrays.equals(bytes, otherTopic.bytes); } Topic(String topic);  Topic(byte[] bytes); byte[] getBytes(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() { Topic topicA = new Topic("0000000000000000000000000000000000000000000000000000000000000001"); Topic topicB = new Topic("0000000000000000000000000000000000000000000000000000000000000001"); Topic topicC = new Topic("0000000000000000000000000000000000000000000000000000000000000002"); Topic topicD = new Topic("0x0000000000000000000000000000000000000000000000000000000000000003"); Assert.assertEquals(topicA, topicB); Assert.assertNotEquals(topicA, topicC); Assert.assertNotEquals(topicA, topicD); }