Month extends RangeUnit { @Override public boolean hasNext() { LocalDate maxDate = getMaxDate(); if (maxDate == null) { return true; } else { LocalDate to = getTo(); int year = maxDate.getYear(); int yearTo = to.getYear(); int month = maxDate.getMonthOfYear(); int monthTo = to.getMonthOfYear(); return year > yearTo || (year == yearTo && month > monthTo); } } 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 testHasNextFalse() throws Exception { LocalDate max = LocalDate.parse("2014-10-31"); Month week = new Month(mToday, mToday, null, max); assertFalse(week.hasNext()); }
@Test public void testHasNextTrue() throws Exception { LocalDate max = LocalDate.parse("2014-11-01"); Month week = new Month(mToday, mToday, null, max); assertTrue(week.hasNext()); }
@Test public void testHasNextYear() throws Exception { LocalDate max = LocalDate.parse("2015-10-08"); Month week = new Month(mToday, mToday, null, max); assertTrue(week.hasNext()); }
@Test public void testHasNextNull() throws Exception { assertTrue(mMonth.hasNext()); }