Week extends RangeUnit { @Override public boolean prev() { if (hasPrev()) { setFrom(getFrom().minusWeeks(1)); setTo(getTo().minusWeeks(1)); build(); return true; } else { return false; } } Week(@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<Day> getDays(); @Override void build();  }
@Test public void testPrev() throws Exception { LocalDate start = LocalDate.parse("2014-07-21"); LocalDate end = LocalDate.parse("2014-07-27"); assertTrue(mWeek.prev()); assertEquals(start, mWeek.getFrom()); assertEquals(end, mWeek.getTo()); assertEquals(start, mWeek.getDays().get(0).getDate()); assertEquals(end, mWeek.getDays().get(6).getDate()); }