anchor.diff:    FlutterVersion mockFlutterVersion;
     LoggingProcessManager loggingProcessManager;
   
  -  setUpAll(() {
  +  setUpAll(() async {
       Cache.disableLocking();
  +    await _ensureFlutterToolsSnapshot();
     });
   
     setUp(() {
  
positive.code:   testUsingContext('cannot create a project if non-empty non-project directory exists with .metadata', () async {
      await projectDir.absolute.childDirectory('blag').create(recursive: true);
      await projectDir.absolute.childFile('.metadata').writeAsString('project_type: blag\n');
      expect(
          () async => await _createAndAnalyzeProject(projectDir, <String>[], <String>[], unexpectedPaths: <String>[
                'android/',
                'ios/',
                '.android/',
                '.ios/',
              ]),
          throwsToolExit(message: 'Sorry, unable to detect the type of project to recreate'));
    }, timeout: allowForRemotePubInvocation, overrides: noColorTerminalOverride);
  
    testUsingContext('Will create an app project if non-empty non-project directory exists without .metadata', () async {
      await projectDir.absolute.childDirectory('blag').create(recursive: true);
      await projectDir.absolute.childDirectory('.idea').create(recursive: true);
      await _createAndAnalyzeProject(projectDir,
        <String>[
          '-i', 'objc', '-a', 'java'
        ], <String>[
  
negative.code:   await _analyzeProject(dir.path);
  }
  
  Future<void> _ensureFlutterToolsSnapshot() async {
    final String flutterToolsPath = fs.path.absolute(fs.path.join(
      'bin',
      'flutter_tools.dart',
    ));
    final String flutterToolsSnapshotPath = fs.path.absolute(fs.path.join(
      '..',
      '..',
      'bin',
      'cache',
      'flutter_tools.snapshot',
    ));
    final String dotPackages = fs.path.absolute(fs.path.join(
      '.packages',
    ));
  
    final File snapshotFile = fs.file(flutterToolsSnapshotPath);
    if (snapshotFile.existsSync()) {
      snapshotFile.renameSync(flutterToolsSnapshotPath + '.bak');
    }
  
    final List<String> snapshotArgs = <String>[
      ...dartVmFlags,
      '--snapshot=$flutterToolsSnapshotPath',
      '--packages=$dotPackages',
      flutterToolsPath,
    ];
    final ProcessResult snapshotResult = await Process.run(
      '../../bin/cache/dart-sdk/bin/dart',
      snapshotArgs,
    );
    if (snapshotResult.exitCode != 0) {
      print(snapshotResult.stdout);
      print(snapshotResult.stderr);
    }
    expect(snapshotResult.exitCode, 0);
  }
  
  Future<void> _restoreFlutterToolsSnapshot() async {
    final String flutterToolsSnapshotPath = fs.path.absolute(fs.path.join(
      '..',
      '..',
      'bin',
      'cache',
      'flutter_tools.snapshot',
    ));
  
    final File snapshotBackup = fs.file(flutterToolsSnapshotPath + '.bak');
    if (!snapshotBackup.existsSync()) {
      // No backup to restore.
      return;
    }
  
    snapshotBackup.renameSync(flutterToolsSnapshotPath);
  }
  
  Future<void> _analyzeProject(String workingDir) async {
    final String flutterToolsSnapshotPath = fs.path.absolute(fs.path.join(
      '..',
      '..',
      'bin',
      'cache',
      'flutter_tools.snapshot',
    ));
  
    final List<String> args = <String>[
      ...dartVmFlags,
      flutterToolsSnapshotPath,
      'analyze',
    ];
  
  