@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; POJO2Parent other = (POJO2Parent) obj; if (children == null) { if (other.children != null) return false; } else if (!children.equals(other.children)) return false; if (sibling == null) { if (other.sibling != null) return false; } else if (!sibling.equals(other.sibling)) return false; return true; }