boolean (@NotNull Collection<?> changes) { List<AbstractFilePatchInProgress.PatchChange> patchChanges = ContainerUtil.findAll(changes, AbstractFilePatchInProgress.PatchChange.class); if (patchChanges.size() == 1 && !patchChanges.get(0).isValid()) { return handleInvalidChangesAndToggle(); } else { return super.toggleChanges(getOnlyValidChanges(patchChanges)); } }