void (final List<UsageInfo> usages, final List<PsiElement> importStatements) { for (Iterator<UsageInfo> iterator = usages.iterator(); iterator.hasNext(); ) { UsageInfo usage = iterator.next(); PsiElement element = usage.getElement(); if (element == null) continue; GrImportStatement stmt = PsiTreeUtil.getParentOfType(element, GrImportStatement.class); if (stmt != null) { importStatements.add(stmt); iterator.remove(); } } }