### Question:
ExpiryDayValidator { public boolean canEdit() { LocalDate todayDate = new LocalDate(); LocalDate maxDate = getMaxDateCanEdit(); return todayDate.isBefore(maxDate) || todayDate.isEqual(maxDate); } ExpiryDayValidator(int expiryDays, String period); boolean canEdit();  }### Answer:
@Test public void testCanNotEditWithPeriodWithSameMinusDaysAsExpiryDays() { LocalDate todayDate = new LocalDate(); int expiryDays = 5; todayDate = todayDate.minusDays(expiryDays); ExpiryDayValidator expiryDayValidator = new ExpiryDayValidator(expiryDays, todayDate.toString(PATTERN)); assertFalse(expiryDayValidator.canEdit()); }
@Test public void testCanEditDateWithLessMinusDaysThanExpiryDays() { LocalDate todayDate = new LocalDate(); int expiryDays = 5; todayDate = todayDate.minusDays(expiryDays - 1); ExpiryDayValidator expiryDayValidator = new ExpiryDayValidator(expiryDays, todayDate.toString(PATTERN)); assertTrue(expiryDayValidator.canEdit()); }
@Test public void testCanNotEditDateWithMorePlusDaysThanExpiryDays() { LocalDate todayDate = new LocalDate(); int expiryDays = 5; todayDate = todayDate.minusDays(expiryDays + 1); ExpiryDayValidator expiryDayValidator = new ExpiryDayValidator(expiryDays, todayDate.toString(PATTERN)); assertFalse(expiryDayValidator.canEdit()); }