@Test
public void testSetMaxDate() {

    Calendar originalDate = Calendar.getInstance();
    mTravelTimePicker.setMaxDate(originalDate.getTimeInMillis()); // set current date
    // open the picker
    mTravelTimePicker.open(getSupportFragmentManager());
    Calendar minDateCalendar = Calendar.getInstance();
    minDateCalendar.setTimeInMillis(mTravelTimePicker.getMaxDate());
    assertThat(minDateCalendar.get(Calendar.YEAR), equalTo(originalDate.get(Calendar.YEAR)));
    assertThat(minDateCalendar.get(Calendar.MONTH), equalTo(originalDate.get(Calendar.MONTH)));
    assertThat(minDateCalendar.get(Calendar.DAY_OF_MONTH), equalTo(originalDate.get(Calendar.DAY_OF_MONTH)));
}