void (String... expected) { final String dirPath = JavaTestUtil.getJavaTestDataPath() + FileUtil.toSystemDependentName("/ide/sourceRootDetection/" + getTestName(true)); final File dir = new File(dirPath); assertTrue(dir.isDirectory()); final List<Pair<File, String>> actual = new ArrayList<>(); for (JavaModuleSourceRoot root : JavaSourceRootDetectionUtil.suggestRoots(dir)) { actual.add(Pair.create(root.getDirectory(), root.getPackagePrefix())); } List<Pair<File, String>> expectedList = new ArrayList<>(); for (int i = 0; i < expected.length / 2; i++) { expectedList.add(Pair.create(new File(dir, expected[2 * i]), expected[2 * i + 1])); } assertSameElements(actual, expectedList); }