Set<Integer> (@NotNull Collection<? extends VcsRef> branches, @NotNull VcsLogStorage storage) { Set<Integer> result = new HashSet<>(); for (VcsRef vcsRef : branches) { result.add(storage.getCommitIndex(vcsRef.getCommitHash(), vcsRef.getRoot())); } return result; }