public Category getCategory(String id) {
        return categoryCache.get(id, key -> categoryRepository.findById(key).orElseThrow(NullPointerException::new));
    }
getCategory

@param id id
@return Category
src/main/java/com/tuituidan/openhub/service/CacheService.java