Node extends GraphObject { @Override public boolean equals(Object obj) { if (!(obj instanceof Node)) return false; return ((Node)obj).getId() == id; } Node();  Node(long id); long getId(); void setId(long id); void addComponent(NodeComponent component); void addComponent(Class<? extends NodeComponent> key, NodeComponent component); C getComponent(Class<C> componentClass); boolean hasComponent(Class<? extends NodeComponent> key); Set<Class<? extends NodeComponent>> getAllComponentClasses(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() { Node n1 = new Node(0); Node n2 = new Node(1); assertEquals(true, n.equals(n1)); assertEquals(false, n.equals(n2)); }