List<VirtualFile> (VirtualFile @NotNull [] roots) { List<VirtualFile> result = new ArrayList<>(); for (VirtualFile root : roots) { VfsUtilCore.visitChildrenRecursively(root, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { if (!file.isDirectory() && file.getBOM() != null) { result.add(file); } return true; } }); } return result; }