### Question:
WeeklyPeriod implements Period { @Override public Date getEndDate() { return endDate; } WeeklyPeriod(Date date); @Override void setStartDate(Date startDate); @Override void setEndDate(Date endDate); @Override Date getStartDate(); @Override Date getEndDate(); @Override String getAsIsoString(); static final String ISO_FORMAT; }### Answer:
@Test public void testGetEnd() throws ParseException { WeeklyPeriod instance = new WeeklyPeriod(new SimpleDateFormat( "yyyy-MM-dd").parse("2012-11-20")); Date expResult = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS") .parse("2012-11-25T23:59:59.999"); Date result = instance.getEndDate(); assertEquals(expResult, result); }
@Test public void testGetEndNotEqualTo() throws ParseException { WeeklyPeriod instance = new WeeklyPeriod(new SimpleDateFormat( "yyyy-MM-dd").parse("2012-11-20")); Date expResult = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss") .parse("2012-11-25T00:00:00"); Date result = instance.getEndDate(); assertThat(expResult, not(equalTo(result))); }