DateRangeCalculator { public static List<DateRange> fromDateList(Date... dateList) { List<DateRange> dateRangeList = new ArrayList<>(); for (Date date : dateList) { dateRangeList.add(new DateRange(date, date)); } return dateRangeList; }  static List<DateRange> fromDateList(Date... dateList); static List<DateRange> fromMinMax(Date minDate, Date maxDate, String steppingPeriodLength, String compositingPeriodLength);  }
@Test public void testFromDateList() throws Exception { List<DateRange> dateRanges = DateRangeCalculator.fromDateList(); assertNotNull(dateRanges); assertEquals(0, dateRanges.size()); dateRanges = DateRangeCalculator.fromDateList(date("2002-01-03")); assertNotNull(dateRanges); assertEquals(1, dateRanges.size()); assertEquals("[2002-01-03:2002-01-03]", dateRanges.get(0).toString()); dateRanges = DateRangeCalculator.fromDateList(date("2002-01-03"), date("2005-05-05")); assertNotNull(dateRanges); assertEquals(2, dateRanges.size()); assertEquals("[2002-01-03:2002-01-03]", dateRanges.get(0).toString()); assertEquals("[2005-05-05:2005-05-05]", dateRanges.get(1).toString()); }