@RequiresEdt
  private @Nullable ShelvedChangeList saveRemainingPatchesIfNeeded(final ShelvedChangeList changeList,
                                                                   final List<? extends FilePatch> remainingPatches,
                                                                   final List<ShelvedBinaryFile> remainingBinaries,
                                                                   CommitContext commitContext,
                                                                   boolean delete) {
    // all changes in the shelved list have been chosen to be applied/deleted
    if (remainingPatches.isEmpty() && remainingBinaries.isEmpty()) {
      if (!delete) {
        recycleChangeList(changeList);
      }
      else if (changeList.isDeleted()) {
        deleteChangeListCompletely(changeList);
      }
      else {
        markChangeListAsDeleted(changeList);
      }
      return null;
    }
    //apply already applied  - do not change anything
    if (!delete && changeList.isRecycled()) return null;

    ShelvedChangeList newlyCreatedList = null;
    if ((delete && changeList.isDeleted())) {
      saveRemainingChangesInList(changeList, remainingPatches, remainingBinaries, commitContext);
    }
    else {
      newlyCreatedList = saveRemainingAndRecycleOthers(changeList, remainingPatches, remainingBinaries, commitContext, delete);
    }
    notifyStateChanged();
    return newlyCreatedList;
  }
@RequiresEdt
  private @Nullable ShelvedChangeList saveRemainingPatchesIfNeeded(final ShelvedChangeList changeList,
                                                                   final List<? extends FilePatch> remainingPatches,
                                                                   final List<ShelvedBinaryFile> remainingBinaries,
                                                                   CommitContext commitContext,
                                                                   boolean delete)