int (File file, @NotNull Set<File> exhausted) { if (exhausted.contains(file)) return 0; File[] children = myChildrenCache.get(file); if (children == null) return 1; return Stream.of(children).mapToInt(f -> exhausted.contains(f) ? 0 : f.isDirectory() ? 5 : 1).sum(); }