AbstractNode implements MediaNode { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final AbstractNode other = (AbstractNode) obj; return Objects.equals(this.id, other.id) && Objects.equals(this.parentId, other.parentId) && Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type) && Objects.equals(this.modifiedDate, other.modifiedDate); } AbstractNode(final NodeType type, final String id, final String parentId, final String name); @Override String getId(); @Override String getParentId(); @Override String getName(); @Override NodeType getType(); @Override Long getModifiedDate(); @Override void setModifiedDate(final Long modifiedDate); @Override String getIconUrl(); @Override void setIconUrl(final String iconUrl); @Override @SuppressWarnings("NullableProblems") int compareTo(final MediaNode o); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { AbstractNodeTester node = buildAbstractNodeTester(""); AbstractNodeTester node1 = buildAbstractNodeTester(""); AbstractNodeTester node2 = buildAbstractNodeTester("2"); assertEquals(node, node); assertEquals(node, node1); assertNotEquals(node, null); assertNotEquals(node, "node"); assertNotEquals(node, node2); assertNotEquals(node, buildAbstractNodeTesterFolder("")); }