### Question:
DayImpression implements Serializable { public static DayImpression subtract(DayImpression d1, DayImpression d2) { DayImpression d3 = new DayImpression(); d3.hours = new ArrayList<>(); for (int i = 0; i < 24; i++) { Impression i1 = d1.hours.get(i); Impression i2 = d2.hours.get(i); Impression i3 = Impression.subtract(i1, i2); d3.hours.add(i3); } LOGGER.debug("dayImpression after subtract:{}", d3.toString()); 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 subtract() { Double[] dayCnt = new Double[]{49D, 60D, 23D, 56D}; DayImpression di = new DayImpression(dayCnt); Double[] dayCnt2 = new Double[]{1D, 2D, 3D, 4D}; DayImpression di2 = new DayImpression(dayCnt2); DayImpression res = DayImpression.subtract(di, di2); List<Impression> hrs = new ArrayList(); H0 h0a = new H0(49D / 24.0), h0b = new H0(1D / 24.0); H1 h1a = new H1(60D / 24.0), h1b = new H1(2D / 24.0); H2 h2a = new H2(23D / 24.0), h2b = new H2(3D / 24.0); H3 h3a = new H3(56D / 24.0), h3b = new H3(4D / 24.0); H0 h0t = new H0(h0a.getT() - h0b.getT()); H1 h1t = new H1(h1a.getT() - h1b.getT()); H2 h2t = new H2(h2a.getT() - h2b.getT()); H3 h3t = new H3(h3a.getT() - h3b.getT()); 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()); }