public bool equals(Object o) { if (null == o) { return false; } if (o == this) { return true; } if (o is Node) { Node n = (Node) o; return getRandomVariable().Equals(n.getRandomVariable()); } return false; }