@Test
public void cancelShouldDismissDialog() {

    mTravelTimePicker.open(getSupportFragmentManager());
    final Dialog dialog = mTravelTimePicker.getDialog();
    assertThat(dialog.isShowing(), is(true));
    ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_NEGATIVE).performClick();
    assertThat(dialog.isShowing(), is(false));
}