CauseItem (CauseItem other) { if (this.equals(other)) return this; if (Objects.equals(this.myTarget, other.myTarget)) { if (myChildren.equals(other.myChildren)) { DfaProblemType mergedProblem = myProblem.tryMerge(other.myProblem); if (mergedProblem != null) { return new CauseItem(myChildren, mergedProblem, myTarget); } } if (getProblemName().equals(other.getProblemName())) { if (tryMergeChildren(other.myChildren)) return this; if (other.tryMergeChildren(this.myChildren)) return other; } } return null; }