anchor.diff:      var invocation = findNode.methodInvocation('codeUnitAt');
       assertType(invocation, 'int');
       assertInvokeType(invocation, 'int Function(int)');
  -    assertElement(invocation.methodName, stringElement.getMethod('codeUnitAt'));
  +    assertElement(
  +      invocation.methodName,
  +      elementMatcher(
  +        stringElement.getMethod('codeUnitAt'),
  +        isLegacy: isNullSafetySdkAndLegacyLibrary,
  +      ),
  +    );
   
       var aRef = invocation.target;
       assertElement(aRef, findElement.topGet('a'));
  
positive.code:     expect(result.errors, isNotEmpty);
  
      PropertyAccessorElement objectHashCode =
          typeProvider.objectType.getGetter('hashCode');
      TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
  
      List<Statement> statements = _getMainStatements(result);
  
negative.code: 
      {
        PrefixedIdentifier prefixed = propertyAccess.target;
        assertPrefixedIdentifier(
          prefixed,
          element: elementMatcher(
            objectHashCode,
            isLegacy: isNullSafetySdkAndLegacyLibrary,
          ),
          type: 'int',
        );
  
        SimpleIdentifier prefix = prefixed.prefix;
        expect(prefix.staticElement, same(foo.getter));
        expect(prefix.staticType, typeProvider.objectType);
  
        SimpleIdentifier identifier = prefixed.identifier;
        assertSimpleIdentifier(
          identifier,
          element: elementMatcher(
            objectHashCode,
            isLegacy: isNullSafetySdkAndLegacyLibrary,
          ),
          type: 'int',
        );
      }
  
      SimpleIdentifier property = propertyAccess.propertyName;
  