List<TestTasksToRun> ( @NotNull ConfigurationContext context, @NotNull PsiElement element, @NotNull List<? extends PsiElement> chosenElements ) { Project project = Objects.requireNonNull(context.getProject()); Module module = Objects.requireNonNull(context.getModule()); VirtualFile directory = ((PsiFileSystemItem)element).getVirtualFile(); List<VirtualFile> sources = findTestSourcesUnderDirectory(module, directory); String testFilter = createTestWildcardFilter(); List<TestTasksToRun> testsTasksToRun = new ArrayList<>(); for (VirtualFile source : sources) { testsTasksToRun.addAll(ContainerUtil.map(findAllTestsTaskToRun(source, project), it -> new TestTasksToRun(it, testFilter))); } return testsTasksToRun; }