private static boolean isEnumerationMethodCalled(
      @NotNull PsiVariable variable, @NotNull PsiElement context) {
      final EnumerationCanBeIterationInspection.EnumerationCanBeIterationVisitor.EnumerationMethodCalledVisitor visitor =
        new EnumerationCanBeIterationInspection.EnumerationCanBeIterationVisitor.EnumerationMethodCalledVisitor(variable);
      context.accept(visitor);
      return visitor.isEnumerationMethodCalled();
    }
private static boolean isEnumerationMethodCalled(
      @NotNull PsiVariable variable, @NotNull PsiElement context)