### Question:
DateColumnValueProvider { public Date getDate(List<? extends String> row, DateColumn column) throws ParseException { StringBuilder dateStringBuilder = new StringBuilder(); dateStringBuilder.append(row.get(column.getPrimaryColumnIndex())); StringBuilder formatStringBuilder = new StringBuilder(); formatStringBuilder.append(column.getPrimaryColumnFormat()); if (column.getSecondaryColumnIndex() >= 0) { dateStringBuilder.append(' '); dateStringBuilder.append(row.get(column.getSecondaryColumnIndex())); formatStringBuilder.append(' '); formatStringBuilder.append(column.getSecondaryColumnFormat()); } String formatString = formatStringBuilder.toString(); String dateString = dateStringBuilder.toString(); if (formatString.contains("S")) { dateString = DateTimeUtilities.fixMillis(dateString); } SimpleDateFormat format = new SimpleDateFormat(formatString); return format.parse(dateString); }  Date getDate(List<? extends String> row, DateColumn column);  }### Answer:
@Test public void testGetDate() throws ParseException { List<List<String>> data = CsvTestUtils.createMultipleTimesData(); List<String> testRow = data.get(1); DateColumn column = new DateColumn(); column.setPrimaryColumnIndex(0); String format = "yyyy-MM-dd'T'HH:mm:ss'Z'"; column.setPrimaryColumnFormat(format); DateColumnValueProvider provider = new DateColumnValueProvider(); Date actualDate = provider.getDate(testRow, column); Date expectedDate = new SimpleDateFormat(format).parse(testRow.get(0)); assertEquals(expectedDate, actualDate); }
@Test public void testGetDateCompositeDate() throws ParseException { List<List<String>> data = CsvTestUtils.createMultipleTimesData(); List<String> testRow = data.get(1); DateColumn column = new DateColumn(); column.setPrimaryColumnIndex(8); String dateFormat = "MM-dd-yyyy"; column.setPrimaryColumnFormat(dateFormat); column.setSecondaryColumnIndex(9); String timeFormat = "HH:mm:ss"; column.setSecondaryColumnFormat(timeFormat); DateColumnValueProvider provider = new DateColumnValueProvider(); Date actualDate = provider.getDate(testRow, column); SimpleDateFormat expectedFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss"); Date expectedDate = expectedFormat.parse(testRow.get(8) + " " + testRow.get(9)); assertEquals(expectedDate, actualDate); }