anchor.diff:          ephemeralOne,
           ephemeralTwo,
         ];
  -      final MockTerminal mockTerminal = MockTerminal();
  -
  -      when(mockTerminal.stdinHasTerminal).thenReturn(true);
  -      when(mockTerminal.promptForCharInput(<String>['1', '2', 'q', 'Q'],
  -        displayAcceptedCharacters: false,
  -        logger: anyNamed('logger'),
  -        prompt: anyNamed('prompt'),
  -      )).thenAnswer((Invocation invocation) async => '2');
  -
  -      final DeviceManager deviceManager = TestDeviceManager(
  -        devices,
  -        logger: BufferLogger.test(),
  -        terminal: mockTerminal,
  +      final FakeTerminal terminal = FakeTerminal()
  +        ..setPrompt(<String>['1', '2', 'q', 'Q'], '2');
  +
  +      final DeviceManager deviceManager = TestDeviceManager(
  +        devices,
  +        logger: BufferLogger.test(),
  +        terminal: terminal,
         );
         final List<Device> filtered = await deviceManager.findTargetDevices(FakeFlutterProject());
   
  
positive.code:       final List<Device> devices = <Device>[
          ephemeralOne,
        ];
        final MockDeviceDiscovery mockDeviceDiscovery = MockDeviceDiscovery();
        when(mockDeviceDiscovery.supportsPlatform).thenReturn(true);
        when(mockDeviceDiscovery.devices).thenAnswer((_) async => devices);
  
        final DeviceManager deviceManager = TestDeviceManager(
          <Device>[],
          deviceDiscoveryOverrides: <DeviceDiscovery>[
            mockDeviceDiscovery
          ],
          logger: BufferLogger.test(),
          terminal: Terminal.test(),
  
negative.code:       );
  
        expect(filtered.single, ephemeralOne);
        expect(deviceDiscovery.devicesCalled, 1);
        expect(deviceDiscovery.discoverDevicesCalled, 1);
      });
    });
  
    group('JSON encode devices', () {
      testWithoutContext('Consistency of JSON representation', () async {
        expect(
          // This tests that fakeDevices is a list of tuples where "second" is the
          // correct JSON representation of the "first". Actual values are irrelevant
  