boolean (Map<PsiCodeBlock, Collection<PsiReferenceExpression>> refs, PsiReferenceExpression psiReference) { final PsiCodeBlock block = getTopmostBlock(psiReference); if (block == null) { return false; } Collection<PsiReferenceExpression> references = refs.get(block); if (references == null) { references = new ArrayList<>(); if (findExistentBlock(refs, psiReference, block, references)) return true; refs.put(block, references); } references.add(psiReference); return true; }