anchor.diff:      // Going up in AST structure to find binary comparison operator for this
       // `indexOf` access. Most of the time it will be a parent, but sometimes
       // it can be wrapped in parentheses or `as` operator.
  -    AstNode? search = indexOfAccess;
  +    AstNode? search = node;
       while (
           search != null && search is Expression && search is! BinaryExpression) {
         search = search.parent;
  
positive.code:   _Visitor(this.rule, this.context);
  
    @override
    void visitSimpleIdentifier(SimpleIdentifier node) {
      // Should be "indexOf".
      var propertyElement = node.staticElement;
      if (propertyElement?.name != 'indexOf') {
        return;
      }
  
      MethodInvocation indexOfAccess;
      InterfaceType type;
  
      var parent = node.parent;
      if (parent is MethodInvocation && node == parent.methodName) {
        indexOfAccess = parent;
        var parentType = parent.target?.staticType;
        if (parentType is! InterfaceType) {
          return;
        }
        type = parentType;
      } else {
        return;
      }
  
      if (!DartTypeUtilities.implementsAnyInterface(
          type, <InterfaceTypeDefinition>[
        InterfaceTypeDefinition('Iterable', 'dart.core'),
        InterfaceTypeDefinition('String', 'dart.core'),
      ])) {
        return;
      }
  
      if (indexOfAccess.parent is AssignmentExpression) {
        // The result of `indexOf` is being assigned before being compared, so
        // it's important. E.g.  `(next = list.indexOf('{')) != -1)`.
        return;
  
negative.code: import 'package:analyzer/dart/ast/ast.dart';
  import 'package:analyzer/dart/ast/token.dart';
  import 'package:analyzer/dart/ast/visitor.dart';
  
  import '../analyzer.dart';
  import '../util/dart_type_utilities.dart';
  