boolean (@NotNull PsiElement element, @NotNull List<PsiLocalVariable> conditionVariables) { return StreamEx.ofTree(element, e -> StreamEx.of(e.getChildren())) .select(PsiReferenceExpression.class) .map(expression -> expression.resolve()) .nonNull() .select(PsiLocalVariable.class) .anyMatch(el -> conditionVariables.contains(el)); }