### Question:
WeeklyTimeWindow { public Date nextOrCurrentStartDate(Date asOf,TimeZone tz){ Date thisWeekStart = thisWeekStartDate(asOf, tz); Date nextWeekStart = nextWeekStartDate(asOf, tz); if(isDateInTimeWindow(asOf, tz)){ return thisWeekStart; } return nextWeekStart; } WeeklyTimeWindow(DayOfWeek startDay,String startTime, int duration, TimeUnit timeUnit);  WeeklyTimeWindow(DayOfWeek startDay,TimeOfDay startTime, int duration, TimeUnit timeUnit);  WeeklyTimeWindow(TimeWindow timeWindow); boolean isDateInTimeWindow(Date asOf,TimeZone tz); Date nextOrCurrentStartDate(Date asOf,TimeZone tz); Date thisWeekStartDate(Date asOf,TimeZone tz); Date nextWeekStartDate(Date asOf,TimeZone tz); static Date calculateEndDate(Date startDate,TimeWindow timeWindow); Date calculateEndDate(Date startDate); static WeeklyTimeWindow nextOrCurrentWindow(List<WeeklyTimeWindow>windows, Date asOfDate,TimeZone tz); static List<WeeklyTimeWindow> sortByStartTime(List<WeeklyTimeWindow>windows,Date asOfDate,TimeZone tz); static List<WeeklyTimeWindow> fromTimeWindowDataListSorted(List<Map<String,Object>>windowAttributes,Calendar cal); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testNextOrCurrentStartDateInWindow() throws Exception{ Date staticCurrentDate = simulateDateWithCST("2016-01-21T06:00:00"); WeeklyTimeWindow window = new WeeklyTimeWindow(DayOfWeek.THURSDAY, "5:00:00", 3,TimeUnit.HOURS); Date expected = simulateDateWithCST("2016-01-21T05:00:00"); Date nextorcurrent = window.nextOrCurrentStartDate(staticCurrentDate,CST); assertEquals(expected, nextorcurrent); }
@Test public void testNextOrCurrentStartDateMissedWindow() throws Exception{ Date staticCurrentDate = simulateDateWithCST("2016-01-21T20:00:00"); WeeklyTimeWindow window = new WeeklyTimeWindow(DayOfWeek.THURSDAY, "5:00:00", 3,TimeUnit.HOURS); Date expected = simulateDateWithCST("2016-01-28T05:00:00"); Date nextorcurrent = window.nextOrCurrentStartDate(staticCurrentDate,CST); assertEquals(expected, nextorcurrent); }