void (VirtualFile dir, Pair<String, JpsModuleSourceRootType<?>>... expected) { Collection<CreateDirectoryCompletionContributor.Variant> variants = ReadAction.compute(() -> new GradleDirectoryCompletionContributor().getVariants(PsiManager.getInstance(myProject).findDirectory(dir)) ); List<Pair<String, JpsModuleSourceRootType<?>>> map = ContainerUtil.map( variants, it -> Pair.create(FileUtil.getRelativePath(dir.getPath(), FileUtil.toSystemIndependentName(it.getPath()), '/'), it.getRootType())); assertSameElements(map, expected); }