@Override public ReviewsSummary getReviewSummary(Hotel hotel) { Collection<RatingCount> ratingCounts = ratingCountListCacheRedisRepository.get( "ratingcounts:hotel:" + hotel.getId(), RatingCount.class); if (ratingCounts == null || ratingCounts.isEmpty()) { ratingCounts = this.hotelRepository.findRatingCounts(hotel); if (ratingCounts != null) { ratingCountListCacheRedisRepository.multiAdd( "ratingcounts:hotel:" + hotel.getId(), ratingCounts, true); ratingCountListCacheRedisRepository.expire( "ratingcounts:hotel:" + hotel.getId(), 60, TimeUnit.SECONDS); } } return new ReviewsSummaryImpl(new ArrayList<>(ratingCounts)); }