@Test
public void singleInstallOnSuccess() {

  // if the installer succeeds on the first try...
  when(myInstaller.installApp(myDevice, myLaunchStatus))
    .thenAnswer(invocationOnMock -> {
      myStopWatchTimeSource.advance(20);
      return new InstallResult(InstallResult.FailureCode.NO_ERROR, null, null);
    });
  RetryingInstallerResult installResult = myRetryingInstaller.install();
  assertThat(installResult.isSuccess()).isTrue();
  assertThat(installResult.getRetryCount()).isEqualTo(1);
  assertThat(installResult.getTotalDuration().toMillis()).isEqualTo(20);
  assertThat(installResult.getLastInstallDuration().toMillis()).isEqualTo(20);
  // then we should only have called it once...
  verify(myInstaller, times(1)).installApp(myDevice, myLaunchStatus);
  // and never prompted the user...
  verify(myPrompter, never()).showQuestionPrompt(anyString());
}