void (String moduleName, JavaSourceRootType type, String... expectedSources) { final ContentEntry[] contentRoots = getContentRoots(moduleName); String rootUrl = contentRoots.length > 1 ? ExternalSystemApiUtil.getExternalProjectPath(getModule(moduleName)) : null; List<String> actual = new ArrayList<>(); for (ContentEntry contentRoot : contentRoots) { rootUrl = VirtualFileManager.extractPath(rootUrl == null ? contentRoot.getUrl() : rootUrl); for (SourceFolder f : contentRoot.getSourceFolders(type)) { String folderUrl = VirtualFileManager.extractPath(f.getUrl()); if (folderUrl.startsWith(rootUrl)) { int length = rootUrl.length() + 1; folderUrl = folderUrl.substring(Math.min(length, folderUrl.length())); } JavaSourceRootProperties properties = f.getJpsElement().getProperties(type); if (properties != null && properties.isForGeneratedSources()) { actual.add(folderUrl); } } } assertOrderedElementsAreEqual(actual, Arrays.asList(expectedSources)); }