void (Collection<UsageInfo> results) { for (Iterator<UsageInfo> iterator = results.iterator(); iterator.hasNext(); ) { UsageInfo info = iterator.next(); if (info == null) continue; final PsiReference ref = info.getReference(); if (ref == null) continue; final PsiElement element = ref.getElement(); if (!(element instanceof GrReferenceElement)) continue; final GroovyResolveResult resolveResult = ((GrReferenceElement<?>)element).advancedResolve(); final PsiElement context = resolveResult.getCurrentFileResolveContext(); if ((context instanceof GrImportStatement) && ((GrImportStatement)context).isAliasedImport()) { iterator.remove(); } } }