Month extends RangeUnit { @Override public boolean select(@NonNull LocalDate date) { int cnt = mWeeks.size(); for (int i = 0; i < cnt; i++) { Week week = mWeeks.get(i); if (week.select(date)) { mSelectedIndex = i; setSelected(true); return true; } } return false; } protected  Month(@NonNull LocalDate date, @NonNull LocalDate today, @Nullable LocalDate minDate,
                    @Nullable LocalDate maxDate); @Override boolean hasNext(); @Override boolean hasPrev(); @Override boolean next(); @Override boolean prev(); @Override int getType(); @Override void deselect(@NonNull LocalDate date); @Override boolean select(@NonNull LocalDate date); @NonNull List<Week> getWeeks(); int getSelectedIndex(); @Override void build();  }
@Test public void testSelectNull() throws Exception { assertFalse(mMonth.select(null)); assertFalse(mMonth.isSelected()); }
@Test public void testSelect() throws Exception { assertTrue(mMonth.select(mToday)); assertTrue(mMonth.isSelected()); List<Week> weeks = mMonth.getWeeks(); for (int i = 0; i < weeks.size(); i++) { Week week = weeks.get(i); if (i == 1) { assertTrue(week.isSelected()); } else { assertFalse(week.isSelected()); } } }