ApplyPatchStatus () { if (! myNotExact.isEmpty()) { return FAILURE; } else { if (myTransformations.isEmpty() && myHadAlreadyAppliedMet) return ALREADY_APPLIED; boolean haveAlreadyApplied = myHadAlreadyAppliedMet; boolean haveTrue = false; for (MyAppliedData data : myTransformations.values()) { if (data.isHaveAlreadyApplied()) { haveAlreadyApplied = true; } else { haveTrue = true; } } if (haveAlreadyApplied && !haveTrue) return ALREADY_APPLIED; if (haveAlreadyApplied) return PARTIAL; return SUCCESS; } }