void (File from, String... expected) { VirtualFile vDir = refreshAndFind(from); assertNotNull(vDir); Set<String> expectedSet = StreamEx.of(expected).map(FileUtil::toSystemIndependentName).append(vDir.getPath()).toSet(); Set<String> actualSet = new HashSet<>(); VfsUtilCore.visitChildrenRecursively(vDir, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { if (!actualSet.add(file.getPath())) { throw new AssertionError(file + " already visited"); } return true; } }); List<String> exp = new ArrayList<>(expectedSet); Collections.sort(exp); List<String> act = new ArrayList<>(actualSet); Collections.sort(act); assertEquals(StringUtil.join(exp, "\n"), StringUtil.join(act, "\n")); }