private static List<Problem> convertToProblems(
     final Collection<HighlightInfo> infos,
     final VirtualFile file,
     final boolean hasErrorElement) {
   List<Problem> problems = new SmartList<Problem>();
   for (HighlightInfo info : infos) {
     if (info.getSeverity() == HighlightSeverity.ERROR) {
       Problem problem = new ProblemImpl(file, info, hasErrorElement);
       problems.add(problem);
     }
   }
   return problems;
 }