class TipsAndTricksServiceImpl implements TipsAndTricksService {

    @Override
    public PageableDto<TipsAndTricksDtoResponse> find(Pageable page, List<String> tags) {
        Page<TipsAndTricks> pages;
        if (tags == null || tags.isEmpty()) {
            pages = tipsAndTricksRepo.findAllByOrderByCreationDateDesc(page);
        } else {
            List<String> lowerCaseTags = tags.stream()
                .map(String::toLowerCase)
                .collect(Collectors.toList());
            pages = tipsAndTricksRepo.find(page, lowerCaseTags);
        }
        return getPagesWithTipsAndTricksResponseDto(pages);
    }

}