List<GrImportStatement> (final GroovyFile file) { final List<GrImportStatement> oldImports = new ArrayList<>(); for (GrImportStatement statement : file.getImportStatements()) { if (!ErrorUtil.containsError(statement)) { oldImports.add(statement); } } return oldImports; }