class EcoNewsCommentServiceImpl implements EcoNewsCommentService {

    public void like(Long id, User user) {
        EcoNewsComment comment = ecoNewsCommentRepo.findById(id)
            .orElseThrow(() -> new NotFoundException(ErrorMessage.COMMENT_NOT_FOUND_EXCEPTION));
        if (comment.getUsersLiked().contains(user)) {
            comment.getUsersLiked().remove(user);
        } else {
            comment.getUsersLiked().add(user);
        }
        ecoNewsCommentRepo.save(comment);
    }

}