public List<AbstractFilePatchInProgress<?>> execute(@NotNull List<? extends FilePatch> list, boolean useProjectRootAsPredefinedBase) {
    final PatchBaseDirectoryDetector directoryDetector = PatchBaseDirectoryDetector.getInstance(myProject);

    myUseProjectRootAsPredefinedBase = useProjectRootAsPredefinedBase;
    List<PatchAndVariants> candidates = new ArrayList<>(list.size());
    List<FilePatch> newOrWithoutMatches = new ArrayList<>();
    findCandidates(list, directoryDetector, candidates, newOrWithoutMatches);

    MultiMap<VirtualFile, AbstractFilePatchInProgress<?>> result = new MultiMap<>();
    // process exact matches: if one, leave and extract. if several - leave only them
    filterExactMatches(candidates, result);

    // partially check by context
    selectByContextOrByStrip(candidates, result); // for text only
    // created or no variants
    workWithNotExisting(directoryDetector, newOrWithoutMatches, result);
    return new ArrayList<>(result.values());
  }
public List<AbstractFilePatchInProgress<?>> execute(@NotNull List<? extends FilePatch> list, boolean useProjectRootAsPredefinedBase)