Stream<SourceFolder> (@NotNull Module module) { Predicate<SourceFolder> forGeneratedSources = JavaProjectRootsUtil::isForGeneratedSources; return Arrays.stream(ModuleRootManager.getInstance(module).getContentEntries()) .flatMap(entry -> entry.getSourceFolders(JavaSourceRootType.TEST_SOURCE).stream()) .filter(forGeneratedSources.negate()); }