LinkedHashSet<String> (@NotNull GroovyFile file) { final LinkedHashSet<String> result = new LinkedHashSet<>(); ContainerUtil.addAll(result, GroovyFileBase.IMPLICITLY_IMPORTED_PACKAGES); final GroovyFileImports fileImports = file.getImports(); for (StarImport starImport : fileImports.getStarImports()) { if (!fileImports.isImplicit(starImport)) continue; result.add(starImport.getPackageFqn()); } result.add(file.getPackageName()); return result; }