### Question:
BookingDaoESImp extends BaseDaoESImp implements BookingDao { @Override public Map<Day, List<BookingBucket>> getBookingBuckets(Set<Day> days) throws IOException { BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); SearchRequest searchRequest; List<String> dayStrs = new ArrayList(Day.getDayStringTreated(days, "-")); append(boolQueryBuilder, dayStrs, "day"); SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().query(boolQueryBuilder).size(MAX_BOOKING_READ_PER_DAY); searchRequest = new SearchRequest(this.bookingBucketsIndex).source(sourceBuilder); ESResponse esResponse = esclient.search(searchRequest); Map<Day, List<BookingBucket>> result = new HashMap<>(); if (esResponse == null) { LOGGER.error("response is null"); return result; } List docs = (List) ((Map) (esResponse.getSourceMap().get("hits"))).get("hits"); for (Object doc : docs) { Map docMap = (Map) doc; BookingBucket bookingBucket = buildBookingBucket(docMap); if (bookingBucket == null) { continue; } Day day = new Day(bookingBucket.getDay()); if (!result.containsKey(day)) { result.put(day, new ArrayList<BookingBucket>()); } result.get(day).add(bookingBucket); } return result; } BookingDaoESImp();  BookingDaoESImp(Properties properties); @Override void removeBooking(String bookingId); @Override String createBooking(Booking booking); @Override Map<Day, List<Booking>> getBookings(Set<Day> days); @Override List<Booking> getBookings(String advId); @Override Booking getBooking(String bookingId); @Override Map<Day, List<BookingBucket>> getBookingBuckets(Set<Day> days); String createBookingBucket(BookingBucket bookingBucket); @Override boolean lockBooking(); @Override void unlockBooking(); @Override BookingBucket getMaxBookingBucketPriority(String day); @Override void updateBookingBucketWithAllocatedAmount(String bookingBucketId, Map<String, Double> newAllocatedAmount); @Override List<BookingBucket> findBookingBucketsWithAllocatedBookingId(String bookingId); @Override void removeBookingBucket(BookingBucket bookingBucket);  }### Answer:
@Test public void getBookingBuckets() throws IOException { BookingDaoESImp bkDaoImp = new BookingDaoESImp(DEF_PROP); bkDaoImp.setESClient(DEF_ESCLI); List<Day> sortedDays = Day.buildSortedDays(DEF_RANGES); Set<Day> daySet = new HashSet<>(sortedDays); Map<Day, List<BookingBucket>> res = bkDaoImp.getBookingBuckets(daySet); assertNotNull(res); List<Range> ranges = new ArrayList<>(); Range r1 = new Range(); r1.setSt("2018-01-07"); r1.setEd("2018-01-07"); r1.setSh("0"); r1.setEh("23"); Range r2 = new Range(); r2.setSt("2018-01-09"); r2.setEd("2018-01-09"); r2.setSh("5"); r2.setEh("22"); Range r3 = new Range(); r3.setSt("2018-11-05"); r3.setEd("2018-11-05"); r3.setSh("7"); r3.setEh("11"); ranges.add(r1); ranges.add(r2); ranges.add(r3); List<Day> sortedDays2 = Day.buildSortedDays(ranges); Set<Day> daySet2 = new HashSet<>(sortedDays2); Map<Day, List<BookingBucket>> res2 = bkDaoImp.getBookingBuckets(daySet2); assertNotNull(res2); }