anchor.diff:  
     group('Gradle', () {
       Directory tempDir;
  -    ProcessManager mockProcessManager;
  +    FakeProcessManager processManager;
       String gradlew;
       AndroidSdk mockAndroidSdk;
       TestUsage testUsage;
   
       setUp(() {
         testUsage = TestUsage();
  -
         tempDir = globals.fs.systemTempDirectory.createTempSync('flutter_tools_packages_test.');
         gradlew = globals.fs.path.join(tempDir.path, 'flutter_project', 'android',
             globals.platform.isWindows ? 'gradlew.bat' : 'gradlew');
  -
  -      mockProcessManager = MockProcessManager();
  -      when(mockProcessManager.run(<String>[gradlew, '-v'],
  -          environment: anyNamed('environment')))
  -        .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(0, 0, '', '')));
  -
  -      when(mockProcessManager.run(<String>[gradlew, 'app:properties'],
  -          workingDirectory: anyNamed('workingDirectory'),
  -          environment: anyNamed('environment')))
  -        .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(0, 0, 'buildDir: irrelevant', '')));
  -
  -      when(mockProcessManager.run(<String>[gradlew, 'app:tasks', '--all', '--console=auto'],
  -          workingDirectory: anyNamed('workingDirectory'),
  -          environment: anyNamed('environment')))
  -        .thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(0, 0, 'assembleRelease', '')));
  -
  -      when(mockProcessManager.runSync(<String>['mdfind', 'kMDItemCFBundleIdentifier="com.google.android.studio*"'],
  -          workingDirectory: anyNamed('workingDirectory'),
  -          environment: anyNamed('environment')))
  -          .thenReturn(ProcessResult(0, 0, '', ''));
  -      // Fallback with error.
  -      final Process process = createMockProcess(exitCode: 1);
  -      when(mockProcessManager.start(any,
  -          workingDirectory: anyNamed('workingDirectory'),
  -          environment: anyNamed('environment')))
  -        .thenAnswer((_) => Future<Process>.value(process));
  -      when(mockProcessManager.canRun(any)).thenReturn(false);
  -
  -      when(mockProcessManager.runSync(
  -        argThat(contains(contains('gen_snapshot'))),
  -        workingDirectory: anyNamed('workingDirectory'),
  -        environment: anyNamed('environment'),
  -      )).thenReturn(ProcessResult(0, 255, '', ''));
  -
  -      when(mockProcessManager.runSync(
  -        <String>['/usr/bin/xcode-select', '--print-path'],
  -        workingDirectory: anyNamed('workingDirectory'),
  -        environment: anyNamed('environment'),
  -      )).thenReturn(ProcessResult(0, 0, '', ''));
  -
  -      when(mockProcessManager.run(
  -        <String>['which', 'pod'],
  -        workingDirectory: anyNamed('workingDirectory'),
  -        environment: anyNamed('environment'),
  -      )).thenAnswer((_) {
  -        return Future<ProcessResult>.value(ProcessResult(0, 0, '', ''));
  -      });
  -
  +      processManager = FakeProcessManager.empty();
         mockAndroidSdk = FakeAndroidSdk(globals.fs.directory('irrelevant'));
       });
   
  
positive.code:   final Directory directory;
  }
  
  class MockProcessManager extends Mock implements ProcessManager {}
  
  /// Creates a mock process that returns with the given [exitCode], [stdout] and [stderr].
  Process createMockProcess({ int exitCode = 0, String stdout = '', String stderr = '' }) {
    final Stream<List<int>> stdoutStream = Stream<List<int>>.fromIterable(<List<int>>[
      utf8.encode(stdout),
    ]);
    final Stream<List<int>> stderrStream = Stream<List<int>>.fromIterable(<List<int>>[
      utf8.encode(stderr),
    ]);
    final Process process = _MockBasicProcess();
  
    when(process.stdout).thenAnswer((_) => stdoutStream);
    when(process.stderr).thenAnswer((_) => stderrStream);
    when(process.exitCode).thenAnswer((_) => Future<int>.value(exitCode));
    return process;
  }
  
  class _MockBasicProcess extends Mock implements Process {}
  
negative.code:           parameters: <String, String>{},
          ),
        ));
        expect(processManager, hasNoRemainingExpectations);
      },
      overrides: <Type, Generator>{
        AndroidSdk: () => mockAndroidSdk,
        FlutterProjectFactory: () => FakeFlutterProjectFactory(tempDir),
        ProcessManager: () => processManager,
        Usage: () => testUsage,
        AndroidStudio: () => FakeAndroidStudio(),
      });
  
      testUsingContext('reports when the app is using AndroidX', () async {
        final String projectPath = await createProject(tempDir, arguments: <String>['--no-pub', '--template=app']);
        processManager.addCommand(FakeCommand(
          command: <String>[
            gradlew,
            '-q',
            '-Ptarget-platform=android-arm,android-arm64,android-x64',
            '-Ptarget=${globals.fs.path.join(tempDir.path, 'flutter_project', 'lib', 'main.dart')}',
            '-Pdart-obfuscation=false',
            '-Ptrack-widget-creation=true',
            '-Ptree-shake-icons=true',
            'assembleRelease',
          ],
          exitCode: 0,
        ));
  
        // The command throws a [ToolExit] because it expects an APK in the file system.
        await expectLater(() => runBuildApkCommand(projectPath), throwsToolExit());
  
        expect(
          testLogger.statusText, allOf(
            isNot(contains("[!] Your app isn't using AndroidX")),
            isNot(contains(
              'To avoid potential build failures, you can quickly migrate your app by '
              'following the steps on https://goo.gl/CP92wY'
            ))
          ),
        );
        expect(testUsage.events, contains(
          const TestUsageEvent(
            'build',
  