void (File file, String relativePath) { File[] actualChildren = file.listFiles(); Set<String> notFound = new HashSet<>(myChildren.keySet()); if (actualChildren != null) { for (File child : actualChildren) { String name = child.getName(); TestFileSystemItem item = myChildren.get(name); if (item == null) { throw new AssertionError("unexpected file: " + relativePath + name); } item.assertFileEqual(child, relativePath + name + "/"); notFound.remove(name); } } Assert.assertTrue("files " + notFound.toString() + " not found in " + relativePath, notFound.isEmpty()); }