boolean (final Collection<? extends PsiReferenceExpression> allReferences, final Map<PsiCodeBlock, Collection<PsiReferenceExpression>> refs) { for (PsiReferenceExpression psiReference : allReferences) { if (!groupReferenceByCodeBlocks(refs, psiReference)) return false; } return true; }