### Question:
BookingDaoESImp extends BaseDaoESImp implements BookingDao { @Override public BookingBucket getMaxBookingBucketPriority(String day) throws IOException { day = day.replace("-", ""); BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder(); append(boolQueryBuilder, Arrays.asList(new String[]{day}), "day"); SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().query(boolQueryBuilder).size(0); TopHitsAggregationBuilder topHitsAggregationBuilder = new TopHitsAggregationBuilder("doc_with_max_priority"); topHitsAggregationBuilder.size(1).sort("priority", SortOrder.DESC); sourceBuilder = sourceBuilder.aggregation(topHitsAggregationBuilder); SearchRequest searchRequest = new SearchRequest(this.bookingBucketsIndex); searchRequest.source(sourceBuilder); ESResponse esResponse = esclient.search(searchRequest); BookingBucket result = null; Object obj = ((Map) (((Map) (esResponse.getSourceMap().get("top_hits#doc_with_max_priority"))).get("hits"))).get("hits"); List<Object> bbList = (List<Object>) obj; if (bbList.size() > 0) { Map bbMap = (Map) bbList.get(0); result = buildBookingBucket(bbMap); } 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 getMaxBookingBucketPriority() throws IOException { BookingDaoESImp bkDaoImp = new BookingDaoESImp(DEF_PROP); bkDaoImp.setESClient(DEF_ESCLI); String day = "20181107"; BookingBucket res = bkDaoImp.getMaxBookingBucketPriority(day); assertNotNull(res); }