DueDatePicker extends RelativeLayout { public void setDueDate(Date dueDate) { if (dueDate == null) { clearAndSelectView(mNoDateView); } else if (DateUtils.isToday(dueDate)) { clearAndSelectView(mTodayView); } else if (DateUtils.isTomorrow(dueDate)) { clearAndSelectView(mTomorrowView); } else { setDateForPicker(dueDate); } } DueDatePicker(Context context);  DueDatePicker(Context context, AttributeSet attrs);  DueDatePicker(Context context, AttributeSet attrs, int defStyleAttr); void setListenerPickDate(ListenerPickDate listenerPickDate); void setDueDate(Date dueDate); Observable<Date> date();  }
@Test public void testSetDueDate() throws Exception { mDueDatePicker.setDueDate(DateUtils.createPastDate()); mDueDatePicker.date().subscribe(date -> { assertEquals("10/10/2000", DateUtils.formatDate(date)); }); assertDueDateSelected(mDayPicker); }