### Question:
IMSTimePoint implements Comparable<IMSTimePoint> { public static List<IMSTimePoint> build(List<Range> ranges) { List<IMSTimePoint> imsTimePointList = new ArrayList<>(); IMSTimePoint localIMSTimePoint; DateTimeFormatter formatDate = DateTimeFormatter.ofPattern(DATE_FORMAT); LocalDate startlocaldate; LocalDate endlocaldate; LocalTime startlocalhour; LocalTime endlocalhour; long startDateTimeEpochMillis; for (Range elt : ranges) { startlocaldate = LocalDate.parse(elt.getSt(), formatDate); startlocalhour = LocalTime.of(Integer.parseInt(elt.getSh()), 0, 0, 0); endlocaldate = LocalDate.parse(elt.getEd(), formatDate); endlocalhour = LocalTime.of(Integer.parseInt(elt.getEh()), 0, 0, 0); LocalDateTime localStartDateTime = LocalDateTime.of(startlocaldate, startlocalhour); startDateTimeEpochMillis = localStartDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); LocalDateTime localEndDateTime = LocalDateTime.of(endlocaldate, endlocalhour); localIMSTimePoint = new IMSTimePoint(startDateTimeEpochMillis); imsTimePointList.add(localIMSTimePoint); while (localStartDateTime.isBefore(localEndDateTime)) { localStartDateTime = localStartDateTime.plusHours(1); startDateTimeEpochMillis = localStartDateTime. atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); localIMSTimePoint = new IMSTimePoint(startDateTimeEpochMillis); imsTimePointList.add(localIMSTimePoint); } } return imsTimePointList; } IMSTimePoint(long epochTime); String toString(); String getDate(); void setDate(String date); int getHourIndex(); void setHourIndex(int hourIndex); static IMSTimePoint incrementHour(IMSTimePoint imsTimePoint); static IMSTimePoint incrementDay(IMSTimePoint imsTimePoint); static List<IMSTimePoint> build(List<Range> ranges); @Override int hashCode(); @Override boolean equals(Object obj); static List<IMSTimePoint> appendListFromStartToEndHours(int start, int end, List<IMSTimePoint> imsTimePointList, Range elt); LocalDateTime getDateTime(); @Override int compareTo(IMSTimePoint o);  }### Answer:
@Test public void build() { IMSTimePoint epochTime = new IMSTimePoint(0); List<Range> ranges = new ArrayList<>(); Range r1 = new Range(); r1.setSt("2018-01-05"); r1.setEd("2018-01-05"); r1.setSh("0"); r1.setEh("23"); Range r2 = new Range(); r2.setSt("2018-01-06"); r2.setEd("2018-01-06"); r2.setSh("0"); r2.setEh("23"); Range r3 = new Range(); r3.setSt("2018-01-07"); r3.setEd("2018-01-07"); r3.setSh("0"); r3.setEh("23"); ranges.add(r1); ranges.add(r2); ranges.add(r3); long epTime = Long.valueOf("1574641835000"); IMSTimePoint epochTime2 = new IMSTimePoint(epTime); epochTime.build(ranges); assertEquals("1969-12-31-16", epochTime.toString()); epochTime2.build(ranges); assertEquals("2019-11-24-16", epochTime2.toString()); }