boolean (@NotNull VirtualFile root, @NotNull Processor<? super VirtualFile> processor) { Ref<Boolean> result = new Ref<>(true); visitChildrenRecursively(root, new VirtualFileVisitor<Void>() { @Override public @NotNull Result visitFileEx(@NotNull VirtualFile file) { if (!processor.process(file)) { result.set(Boolean.FALSE); return skipTo(root); } return CONTINUE; } }); return result.get(); }