@Test void testEqualsNotSameType() throws Exception { AbstractTopic t1 = new TestingTopic("home/test"); AbstractTopic t2 = new TestingTopic("+/+"); AbstractTopic t3 = new TestingTopic("#"); Assertions.assertFalse(t1.equals(new Object()), t1 + " should not be equal to a empty object."); Assertions.assertFalse(t2.equals(new Object()), t2 + " should not be equal to a empty object."); Assertions.assertFalse(t3.equals(new Object()), t3 + " should not be equal to a empty object."); }
@Override public boolean equals(Object obj) { if (!(obj instanceof AbstractTopic)) return false; AbstractTopic t = (AbstractTopic) obj; return (t.topicLevels.equals(this.topicLevels) && (t.special == this.special)); }
AbstractTopic implements Topic { @Override public boolean equals(Object obj) { if (!(obj instanceof AbstractTopic)) return false; AbstractTopic t = (AbstractTopic) obj; return (t.topicLevels.equals(this.topicLevels) && (t.special == this.special)); } }
AbstractTopic implements Topic { @Override public boolean equals(Object obj) { if (!(obj instanceof AbstractTopic)) return false; AbstractTopic t = (AbstractTopic) obj; return (t.topicLevels.equals(this.topicLevels) && (t.special == this.special)); } protected  AbstractTopic(String topicString); }
AbstractTopic implements Topic { @Override public boolean equals(Object obj) { if (!(obj instanceof AbstractTopic)) return false; AbstractTopic t = (AbstractTopic) obj; return (t.topicLevels.equals(this.topicLevels) && (t.special == this.special)); } protected  AbstractTopic(String topicString); @Override String getStringRepresentation(); @Override List<TopicLevel> getTopicLevels(); @Override boolean isSpecialTopic(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
AbstractTopic implements Topic { @Override public boolean equals(Object obj) { if (!(obj instanceof AbstractTopic)) return false; AbstractTopic t = (AbstractTopic) obj; return (t.topicLevels.equals(this.topicLevels) && (t.special == this.special)); } protected  AbstractTopic(String topicString); @Override String getStringRepresentation(); @Override List<TopicLevel> getTopicLevels(); @Override boolean isSpecialTopic(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }