CommittedChangeList (@NotNull RepositoryLocationGroup group, @NotNull List<? extends CommittedChangeList> lists) { if (lists.size() == 1) { return lists.get(0); } final CommittedChangeList result = lists.get(0); Set<Change> processed = new HashSet<>(result.getChanges()); for (int i = 1; i < lists.size(); i++) { for (Change change : lists.get(i).getChanges()) { if (!processed.add(change)) { result.getChanges().add(change); } } } return result; }