void (@NotNull Collection<? extends VcsRef> actual, @NotNull List<String> expectedSingleGroups, Pair<String, List<String>>... expectedOtherGroups) { List<RefGroup> actualGroups = new GitRefManager(getProject(), repositoryManager).groupForBranchFilter(actual); List<SingletonRefGroup> singleGroups = ContainerUtil.findAll(actualGroups, SingletonRefGroup.class); assertEquals(expectedSingleGroups, ContainerUtil.map(singleGroups, (Function<RefGroup, String>)singletonRefGroup -> singletonRefGroup.getName())); actualGroups.removeAll(singleGroups); assertEquals(Arrays.asList(expectedOtherGroups), ContainerUtil.map(actualGroups, refGroup -> Pair.create(refGroup.getName(), ContainerUtil.map(refGroup.getRefs(), vcsRef -> vcsRef.getName())))); }