List<VirtualFile> (Collection<? extends SimpleClasspathElement> cpeList, boolean refresh) { VirtualFileManager fileManager = VirtualFileManager.getInstance(); List<VirtualFile> files = new ArrayList<>(); for (SimpleClasspathElement cpe : cpeList) { for (String fileUrl : cpe.getClassesRootUrls()) { VirtualFile file = refresh ? fileManager.refreshAndFindFileByUrl(fileUrl) : fileManager.findFileByUrl(fileUrl); if (file != null) { files.add(file); } } } return files; }