### Question:
DayImpression implements Serializable { @Override public String toString() { String result = "{"; if (getDate() != null) { result += "date" + getDate(); } result += "hours:"; List<Impression> hoursList = getHours(); for (Impression hour : hoursList) { result += hour.toString(); } result += "}"; return result; } DayImpression(String date, List<Impression> hours);  DayImpression();  DayImpression(Double[] dayCounts);  DayImpression(Object hoursMap); String getDate(); void setDate(String date); List<Impression> getHours(); void setHours(List<Impression> hours); void initAggregate(double[] aggregatedHCounts); long countImpressions(double price, TargetingChannel.PriceModel priceModel); static DayImpression add(DayImpression d1, DayImpression d2); static DayImpression buildEmptyDayImpression(String date); static DayImpression subtract(DayImpression d1, DayImpression d2); static DayImpression multiply(DayImpression d1, double r); @Override String toString();  }### Answer:
@Test public void testToString() { Double[] dayCnt = new Double[]{10D, 20D, 30D, 40D}; DayImpression di = new DayImpression(dayCnt); List<Impression> hrs = new ArrayList(); H0 h0t = new H0(10D / 24.0); H1 h1t = new H1(20D / 24.0); H2 h2t = new H2(30D / 24.0); H3 h3t = new H3(40D / 24.0); Impression imp = new Impression(h0t, h1t, h2t, h3t); for (int i = 0; i < 24; i++) { hrs.add(imp); } DayImpression exp = new DayImpression(); exp.setHours(hrs); assertEquals(exp.toString(), di.toString()); }