RangeUnit extends CalendarUnit { LocalDate getFirstEnabled() { LocalDate from = getFrom(); if (mMinDate != null && from.isBefore(mMinDate)) { return mMinDate; } else { return from; } } protected  RangeUnit(@NonNull LocalDate from, @NonNull LocalDate to, @NonNull LocalDate today,
            @Nullable LocalDate minDate, @Nullable LocalDate maxDate); @Nullable LocalDate getMinDate(); @Nullable LocalDate getMaxDate(); int getFirstWeek(@Nullable LocalDate firstDayOfMonth);  }
@Test public void testGetFirstEnabledNullMin() throws Exception { LocalDate today = LocalDate.now(); RangeUnit unit = new Week(today, today, null, null); assertEquals(today.withDayOfWeek(DateTimeConstants.MONDAY), unit.getFirstEnabled()); }
@Test public void testGetFirstEnabledBeforeMin() throws Exception { LocalDate today = LocalDate.now(); RangeUnit unit = new Week(today, today, today.plusDays(1), null); assertEquals(today.plusDays(1), unit.getFirstEnabled()); }
@Test public void testGetFirstEnabled() throws Exception { assertEquals(mRangeUnit.getFrom(), mRangeUnit.getFirstEnabled()); }