### Question:
TimeRange { public TimeRange getMonthBefore() { final GregorianCalendar utcCalendar = getCalendarAtCenter(); utcCalendar.add(Calendar.MONTH, -1); final Date beginningOfMonth = getBeginningOfMonth(utcCalendar); final Date endOfMonth = getEndOfMonth(utcCalendar); return new TimeRange(beginningOfMonth, endOfMonth); } TimeRange(Date startDate, Date stopDate); Date getStartDate(); Date getStopDate(); boolean includes(long actualTime); boolean intersectsWith(TimeRange other); TimeRange getCenterMonth(); TimeRange getMonthBefore(); TimeRange getMonthAfter();  }### Answer:
@Test public void testGetMonthBefore() { final Date startDate = createDate(2010, 3, 13, 0, 0, 0); final Date endDate = createDate(2010, 5, 17, 23, 59, 59); final TimeRange timeRange = new TimeRange(startDate, endDate); final TimeRange centerMonth = timeRange.getMonthBefore(); assertNotNull(centerMonth); assertEquals(createDate(2010, 3, 1, 0, 0, 0).getTime(), centerMonth.getStartDate().getTime()); assertEquals(createDate(2010, 4, 1, 0, 0, 0).getTime(), centerMonth.getStopDate().getTime()); }