public static void withLaunchPreventingStartServiceListenerInDependencyResolver() {
    StartServiceListener mockListener = Mockito.mock(StartServiceListener.class);
    doReturn(true)
        .when(mockListener)
        .onStartServiceInvoked(Mockito.anyObject(), Mockito.anyObject());
    DependencyInjector.setStartServiceListener(mockListener);
  }
Configures the {@link DependencyInjector} with a {@link StartServiceListener} that prevents
service launches.
javatests/com/google/android/apps/authenticator/testing/TestUtilities.java