List<SourceFolder> (@Nullable String rootUrl, ContentEntry[] contentRoots, @NotNull JpsModuleSourceRootType<?> rootType, String... expected) { List<SourceFolder> result = new ArrayList<>(); List<String> actual = new ArrayList<>(); for (ContentEntry contentRoot : contentRoots) { for (SourceFolder f : contentRoot.getSourceFolders(rootType)) { rootUrl = VirtualFileManager.extractPath(rootUrl == null ? contentRoot.getUrl() : rootUrl); String folderUrl = VirtualFileManager.extractPath(f.getUrl()); if (folderUrl.startsWith(rootUrl)) { int length = rootUrl.length() + 1; folderUrl = folderUrl.substring(Math.min(length, folderUrl.length())); } actual.add(folderUrl); result.add(f); } } assertOrderedElementsAreEqual(actual, Arrays.asList(expected)); return result; }