### Question:
DataAggregator { public ReportLine append(ReportLine row) { synchronized (this) { String usageInterval = truncDate(row.getUsageDate()); row.setUsageDate(usageInterval); int index = Collections.binarySearch(reportLines, row, aggComparator); if (index < 0) { index = -index; if (index > reportLines.size()) { reportLines.add(row); } else { reportLines.add(index - 1, row); } } else { ReportLine found = reportLines.get(index); found.setUsage(found.getUsage() + row.getUsage()); found.setCost(found.getCost() + row.getCost()); return found; } } return row; } DataAggregator(AggregateGranularity granularity); AggregateGranularity getGranularity(); ReportLine append(ReportLine row); int size(); ReportLine get(int index); void clear();  }### Answer:
@Test public void append() { UsageDataList list = new UsageDataList(); list.append("2017-04-12"); list.append("2017-04-12"); list.append("2017-04-14"); assertEquals(2, list.size()); assertEquals(Boolean.FALSE, list.get("2017-04-12")); assertEquals(Boolean.FALSE, list.get("2017-04-14")); list.set("2017-04-14", true); assertEquals(Boolean.TRUE, list.get("2017-04-14")); list.clear(); assertEquals(0, list.size()); }