Commenter { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Commenter other = (Commenter) obj; return Objects.equals(this.id, other.id); } Commenter(Integer id, String name, String email, boolean dev); Integer getId(); String getName(); String getEmail(); boolean isDev(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { Commenter equal = new Commenter(COMMENTER_ID, "Tester Jr", "testerjr@test.com", IS_DEV); boolean result = instance.equals(equal); assertEquals(true, result); assertEquals(instance.hashCode(), equal.hashCode()); }