void (DirectoryHistoryDialogModel model, List<DirectoryChange> selected) { final Set<DirectoryChange> selectedSet = new HashSet<>(selected); int index = 0; List<Change> changes = new ArrayList<>(); for (DirectoryChange change : iterFileChanges()) { if (selectedSet.contains(change)) index = changes.size(); changes.add(change); } ShowDiffAction.showDiffForChange(myProject, changes, index, new ShowDiffContext(DiffDialogHints.FRAME)); }