anchor.diff:      });
     }
   
  +  void test_applyHintAction() async {
  +    final path = convertPath('/home/tests/bin/test.dart');
  +    final file = getFile(path);
  +    final content = r'''
  +int x;
  +int y = x;
  +''';
  +    file.writeAsStringSync(content);
  +    final migratedContent = '''
  +int? x;
  +int? y = x;
  +''';
  +    final unitInfo = await buildInfoForSingleTestFile(content,
  +        migratedContent: migratedContent);
  +    site.unitInfoMap[path] = unitInfo;
  +    await site.performHintAction(
  +        unitInfo.regions[1].traces[0].entries[0].hintActions[0]);
  +    await site.performHintAction(
  +        unitInfo.regions[1].traces[0].entries[2].hintActions[0]);
  +    expect(file.readAsStringSync(), '''
  +int/*?*/ x;
  +int/*?*/ y = x;
  +''');
  +    expect(unitInfo.content, '''
  +int/*?*/? x;
  +int/*?*/? y = x;
  +''');
  +    assertRegion(
  +        region: unitInfo.regions[0], offset: unitInfo.content.indexOf('? x'));
  +    assertRegion(
  +        region: unitInfo.regions[1], offset: unitInfo.content.indexOf('? y'));
  +    final targets = List<NavigationTarget>.from(unitInfo.targets);
  +    assertInTargets(
  +        targets: targets,
  +        offset: unitInfo.content.indexOf('x'),
  +        offsetMapper: unitInfo.offsetMapper);
  +    assertInTargets(
  +        targets: targets,
  +        offset: unitInfo.content.indexOf('y'),
  +        offsetMapper: unitInfo.offsetMapper);
  +    var trace = unitInfo.regions[1].traces[0];
  +    assertTraceEntry(unitInfo, trace.entries[0], null,
  +        unitInfo.content.indexOf('int/*?*/? y'), contains('y (test.dart:2:1)'));
  +    assertTraceEntry(unitInfo, trace.entries[1], 'y',
  +        unitInfo.content.indexOf('= x;') + '= '.length, contains('data flow'));
  +    expect(state.hasBeenApplied, false);
  +    expect(state.needsRerun, true);
  +  }
  +
     void test_performEdit_multiple() async {
       final path = convertPath('/test.dart');
       final file = getFile(path);
  
positive.code:     final content = 'void main() {}';
      file.writeAsStringSync(content);
      site.unitInfoMap[path] = UnitInfo(path)..diskContent = content;
      dartfixListener.addSourceChange(
          'test change',
          Location(path, 10, 0, 1, 10),
          SourceChange('test change', edits: [
            SourceFileEdit(path, 0, edits: [
              SourceEdit(10, 0, 'List args'),
              SourceEdit(13, 0, '\n  print(args);\n')
            ])
          ]));
      site.performApply();
      expect(file.readAsStringSync(), '''
  
negative.code:     file.writeAsStringSync(content);
      site.unitInfoMap[path] = UnitInfo(path)..diskContent = content;
      // Add a source change for analysis_options, which has no UnitInfo.
      dartfixListener.addSourceFileEdit(
          'enable experiment',
          Location(analysisOptionsPath, 9, 0, 1, 9),
          SourceFileEdit(analysisOptionsPath, 0, edits: [
            SourceEdit(9, 0, '\n  enable-experiment:\n  - non-nullable')
          ]));
      // This should not crash.
      site.performApply();
  