List<PsiReferenceExpression> (@NotNull PsiLocalVariable variable) { final List<PsiReferenceExpression> result = new SmartList<>(); //noinspection ConstantConditions ReferencesSearch.search(variable, variable.getUseScope()) .forEach(reference -> reference instanceof PsiReferenceExpression && result.add((PsiReferenceExpression)reference)); return result; }