public boolean equals(Object obj) { if (obj instanceof AtomData) { AtomData other = (AtomData) obj; if (name == null) { if (other.name != null) { return false; } } else { if (!name.equals(other.name)) { return false; } } if (child != null) { return child.equals(other.child); } return other.child == null; } return false; }