void (File[] baseDirs, Collection<File> files, String[] expected) { List<String> relativePaths = new ArrayList<>(); for (File file : files) { String path = file.getAbsolutePath(); for (File baseDir : baseDirs) { if (baseDir != null && FileUtil.isAncestor(baseDir, file, false)) { path = FileUtil.getRelativePath(baseDir, file); break; } } relativePaths.add(FileUtil.toSystemIndependentName(path)); } UsefulTestCase.assertSameElements(relativePaths, expected); }