Smell { @Override public int hashCode() { return Objects.hash(type, instance, file, parent); } Smell(String type, String instance, String file); static Smell fromPaprikaInstance(Map<String, Object> smell, String type); static Smell fromDetectorInstance(Map<String, Object> smell); static Smell copyWithoutParent(Smell smell); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); public int id; final String type; final String instance; final String file; public Smell parent; }
@Test public void testSmellHashcodeEquality() { assertEquals(first.hashCode(), second.hashCode()); assertNotEquals(first.hashCode(), third.hashCode()); second.parent = first; assertNotEquals(first.hashCode(), second.hashCode()); }