Esempio n. 1
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof Node)) return false;

    Node<?> node = (Node<?>) o;

    if (getId() != node.getId()) return false;
    return !(getData() != null ? !getData().equals(node.getData()) : node.getData() != null);
  }
Esempio n. 2
0
 public Node(Node otherNode) {
   this.id = otherNode.getId();
   this.data = (T) otherNode.getData();
 }