List<VirtualFile> (@NotNull Module module, @NotNull VirtualFile directory) { DataNode<ModuleData> moduleDataNode = GradleUtil.findGradleModuleData(module); if (moduleDataNode == null) return Collections.emptyList(); String rootPath = directory.getPath(); return ExternalSystemApiUtil.findAll(moduleDataNode, ProjectKeys.TEST).stream() .map(DataNode::getData) .flatMap(it -> it.getSourceFolders().stream()) .filter(it -> FileUtil.isAncestor(rootPath, it, false)) .map(it -> VfsUtil.findFile(Paths.get(it), false)) .filter(Objects::nonNull) .distinct() .collect(Collectors.toList()); }