anchor.diff:          expectedContextSearch: 'newName() {} // marker');
     }
   
  -  test_checkFinalConditions_shadowsSuper_inSubClass_FieldElement() async {
  -    indexTestUnit('''
  -class A {
  -  int newName; // marker
  -}
  -class B extends A {
  -  test() {}
  -}
  -class C extends B {
  -  main() {
  -    print(newName);
  -  }
  -}
  -''');
  -    createRenameRefactoringAtString('test() {}');
  -    // check status
  -    refactoring.newName = 'newName';
  -    RefactoringStatus status = await refactoring.checkFinalConditions();
  -    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
  -        expectedMessage: "Renamed method will shadow field 'A.newName'.",
  -        expectedContextSearch: 'newName; // marker');
  -  }
  -
  -  test_checkFinalConditions_shadowsSuper_MethodElement() async {
  -    indexTestUnit('''
  -class A {
  -  test() {}
  -}
  -class B extends A {
  +  test_checkFinalConditions_shadowsSuper_MethodElement_otherLib() async {
  +    var libCode = r'''
  +class A {
     newName() {} // marker
  -  main() {
  -    test();
  -  }
  -}
  -''');
  -    createRenameRefactoringAtString('test() {}');
  -    // check status
  -    refactoring.newName = 'newName';
  -    RefactoringStatus status = await refactoring.checkFinalConditions();
  -    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
  -        expectedMessage:
  -            "Renamed method will be shadowed by method 'B.newName'.",
  -        expectedContextSearch: 'newName() {} // marker');
  +}
  +''';
  +    indexUnit('/lib.dart', libCode);
  +    indexTestUnit('''
  +import 'lib.dart';
  +class B extends A {
  +  test() {}
  +}
  +''');
  +    createRenameRefactoringAtString('test() {}');
  +    // check status
  +    refactoring.newName = 'newName';
  +    RefactoringStatus status = await refactoring.checkFinalConditions();
  +    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
  +        expectedMessage: "Renamed method will shadow method 'A.newName'.",
  +        expectedContextRange: new SourceRange(
  +            libCode.indexOf('newName() {} // marker'), 'newName'.length));
     }
   
     test_checkInitialConditions_inSDK() async {
  
positive.code: 
  import 'package:analysis_server/plugin/protocol/protocol.dart';
  import 'package:analysis_server/src/services/correction/status.dart';
  import 'package:test_reflective_loader/test_reflective_loader.dart';
  import 'package:unittest/unittest.dart';
  
  
negative.code:         expectedContextSearch: 'test(); // marker');
    }
  
    test_checkFinalConditions_shadowedBySub_MethodElement() async {
      indexTestUnit('''
  class A {
    test() {}
  }
  class B extends A {
    newName() {} // marker
    main() {
      test();
    }
  }
  ''');
      createRenameRefactoringAtString('test() {}');
      // check status
      refactoring.newName = 'newName';
      RefactoringStatus status = await refactoring.checkFinalConditions();
      assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
          expectedMessage:
              "Renamed method will be shadowed by method 'B.newName'.",
          expectedContextSearch: 'newName() {} // marker');
    }
  
    test_checkFinalConditions_shadowsSuper_FieldElement() async {
      indexTestUnit('''
  class A {
    int newName; // marker
  }
  class B extends A {
    test() {}
  }
  class C extends B {
    main() {
      print(newName);
    }
  }
  ''');
      createRenameRefactoringAtString('test() {}');
      // check status
      refactoring.newName = 'newName';
      RefactoringStatus status = await refactoring.checkFinalConditions();
      assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
          expectedMessage: "Renamed method will shadow field 'A.newName'.",
          expectedContextSearch: 'newName; // marker');
    }
  
    test_checkFinalConditions_shadowsSuper_MethodElement() async {
      indexTestUnit('''
  class A {
    newName() {} // marker
  }
  class B extends A {
    test() {}
  }
  ''');
      createRenameRefactoringAtString('test() {}');
  