private static boolean isDeclaredVariable(PsiElement element, Set<PsiVariable> declaredVariables) {
      PsiVariable variable = tryCast(element, PsiVariable.class);
      return variable == null || declaredVariables.contains(variable);
    }
private static boolean isDeclaredVariable(PsiElement element, Set<PsiVariable> declaredVariables)