LinearGraphController (@NotNull LinearGraphController baseController, @NotNull SortType sortType, @Nullable Set<? extends CommitId> visibleHeads, @Nullable Set<? extends CommitId> matchingCommits) { Set<Integer> visibleHeadsIds = visibleHeads != null ? myPermanentCommitsInfo.convertToNodeIds(visibleHeads, true) : null; if (matchingCommits != null) { return new FilteredController(baseController, this, myPermanentCommitsInfo.convertToNodeIds(matchingCommits), visibleHeadsIds); } if (sortType == SortType.LinearBek) { if (visibleHeadsIds != null) { return new BranchFilterController(baseController, this, visibleHeadsIds); } return baseController; } return new CollapsedController(baseController, this, visibleHeadsIds); }