### Question:
DayImpression implements Serializable { public static DayImpression multiply(DayImpression d1, double r) { DayImpression d3 = new DayImpression(); d3.hours = new ArrayList<>(); for (int i = 0; i < 24; i++) { Impression i1 = d1.hours.get(i); Impression i3 = Impression.multiply(i1, r); d3.hours.add(i3); } return d3; } 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 multiply() { Double[] dayCnt = new Double[]{10D, 20D, 30D, 40D}; DayImpression di = new DayImpression(dayCnt); DayImpression res = DayImpression.multiply(di, 2); System.out.println("multiply " + res); List<Impression> hrs = new ArrayList(); H0 h0a = new H0(10D / 24.0), h0t = new H0(h0a.getT() * 2); H1 h1a = new H1(20D / 24.0), h1t = new H1(h1a.getT() * 2); H2 h2a = new H2(30D / 24.0), h2t = new H2(h2a.getT() * 2); H3 h3a = new H3(40D / 24.0), h3t = new H3(h3a.getT() * 2); 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(), res.toString()); }