@Test
  public void whenOnDismissed_thenCallbackInformedOfEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_MANUAL;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(callback).onDismissed(snackbar, dismissEvent);
  }
  @Test
  public void givenConsecutiveEvent_whenOnDismissed_thenSnackbarCallbackConsecutiveEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_CONSECUTIVE;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(snackbarCallback).onSnackbarDismissedAfterAnotherShown(snackbar);
  }
  @Test
  public void givenManualEvent_whenOnDismissed_thenSnackbarCallbackManualEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_MANUAL;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(snackbarCallback).onSnackbarManuallyDismissed(snackbar);
  }
  @Test
  public void givenTimeoutEvent_whenOnDismissed_thenSnackbarCallbackTimeoutEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_TIMEOUT;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(snackbarCallback).onSnackbarTimedOut(snackbar);
  }
  @Test
  public void givenActionEvent_whenOnDismissed_thenSnackbarCallbackActionEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_ACTION;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(snackbarCallback).onSnackbarActionPressed(snackbar);
  }
  @Test
  public void givenSwipeEvent_whenOnDismissed_thenSnackbarCallbackSwipedEvent() {
    int dismissEvent = Callback.DISMISS_EVENT_SWIPE;

    callbackUnderTest.onDismissed(snackbar, dismissEvent);

    verify(snackbarCallback).onSnackbarSwiped(snackbar);
  }
  @Test
  public void givenNoCallback_whenCreated_thenSetupCorrectly() {
    int dismissEvent = Callback.DISMISS_EVENT_ACTION;

    SnackbarCombinedCallback testCallback = new SnackbarCombinedCallback(snackbarCallback);
    testCallback.onShown(snackbar);
    testCallback.onDismissed(snackbar, dismissEvent);

    assertThat(testCallback.callback).isNull();
    assertThat(testCallback.snackbarCallback).isEqualTo(snackbarCallback);
    verify(snackbarCallback).onSnackbarShown(snackbar);
    verify(snackbarCallback).onSnackbarActionPressed(snackbar);
  }
  @Test
  public void whenCreatedUsingBuilder_thenAllCallbacksInformedOfEvents() {
    SnackbarCombinedCallback actual =
        SnackbarCombinedCallback.builder()
            .callback(callback)
            .snackbarCallback(snackbarCallback)
            .showCallback(showCallback)
            .dismissCallback(dismissCallback)
            .actionDismissCallback(actionDismissCallback)
            .swipeDismissCallback(swipeDismissCallback)
            .timeoutDismissCallback(timeoutDismissCallback)
            .manualDismissCallback(manualDismissCallback)
            .consecutiveDismissCallback(consecutiveDismissCallback)
            .build();

    actual.onShown(snackbar);
    actual.onDismissed(snackbar, Callback.DISMISS_EVENT_ACTION);
    actual.onDismissed(snackbar, Callback.DISMISS_EVENT_SWIPE);
    actual.onDismissed(snackbar, Callback.DISMISS_EVENT_TIMEOUT);
    actual.onDismissed(snackbar, Callback.DISMISS_EVENT_MANUAL);
    actual.onDismissed(snackbar, Callback.DISMISS_EVENT_CONSECUTIVE);

    verify(callback).onShown(snackbar);
    verify(snackbarCallback).onSnackbarShown(snackbar);
    verify(showCallback).onSnackbarShown(snackbar);
    verify(dismissCallback).onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_ACTION);
    verify(dismissCallback).onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_SWIPE);
    verify(dismissCallback).onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_TIMEOUT);
    verify(dismissCallback).onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_MANUAL);
    verify(dismissCallback).onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_CONSECUTIVE);
    verify(actionDismissCallback).onSnackbarActionPressed(snackbar);
    verify(swipeDismissCallback).onSnackbarSwiped(snackbar);
    verify(timeoutDismissCallback).onSnackbarTimedOut(snackbar);
    verify(manualDismissCallback).onSnackbarManuallyDismissed(snackbar);
    verify(consecutiveDismissCallback).onSnackbarDismissedAfterAnotherShown(snackbar);
  }
  @Test
  public void whenOnDismissed_thenSnackbarCallbackInformedOfEvent() {
    callbackUnderTest.onDismissed(snackbar, Callback.DISMISS_EVENT_MANUAL);

    verify(snackbarCallback).onSnackbarDismissed(snackbar);
  }