@Override
  public View onCreateInputView() {
    final View view = super.onCreateInputView();
    // triggering a new controller creation
    mKeyPreviewSubject.onNext(SystemClock.uptimeMillis());
    return view;
  }
@Test
  public void testNewKeyPreviewControllerOnInputViewReCreate() {
    simulateOnStartInputFlow();
    final ArgumentCaptor<KeyPreviewsController> captor =
        ArgumentCaptor.forClass(KeyPreviewsController.class);
    Mockito.verify(mAnySoftKeyboardUnderTest.getSpiedKeyboardView())
        .setKeyPreviewController(captor.capture());
    final KeyPreviewsController firstInstance = captor.getValue();
    simulateFinishInputFlow();

    mAnySoftKeyboardUnderTest.onCreateInputView();
    simulateOnStartInputFlow();
    Mockito.verify(mAnySoftKeyboardUnderTest.getSpiedKeyboardView())
        .setKeyPreviewController(
            Mockito.argThat(argument -> argument != null && argument != firstInstance));
  }