public void searchForAddOns() {
    mDialogController.showDialog(LEAVE);
  }
@Test
  public void testCancelHappyPath() {
    Application context = ApplicationProvider.getApplicationContext();
    ShadowApplication shadowApplication = Shadows.shadowOf(context);

    final AddOnStoreSearchController underTest = new AddOnStoreSearchController(context, "add on");

    underTest.searchForAddOns();

    var leaveDialog = GeneralDialogTestUtil.getLatestShownDialog();
    Assert.assertEquals(
        "Leaving AnySoftKeyboard", GeneralDialogTestUtil.getTitleFromDialog(leaveDialog));

    var button = leaveDialog.getButton(DialogInterface.BUTTON_NEGATIVE);
    Shadows.shadowOf(button).getOnClickListener().onClick(button);

    Assert.assertSame(
        GeneralDialogTestUtil.NO_DIALOG, GeneralDialogTestUtil.getLatestShownDialog());

    Assert.assertNull(shadowApplication.getNextStartedActivity());
  }