class HabitStatisticServiceImpl implements HabitStatisticService {

    @Override
    public List<Habit> findAllHabitsByStatus(Long userId, Boolean status) {
        List<Habit> habitList = findAllHabitsByUserId(userId)
            .stream()
            .filter(habit -> habit.getStatusHabit().equals(status))
            .collect(Collectors.toList());
        if (habitList.isEmpty()) {
            throw new NotFoundException(ErrorMessage.USER_HAS_NOT_HABITS_WITH_SUCH_STATUS + status);
        }
        return habitList;
    }

    @Autowired public  HabitStatisticServiceImpl(HabitStatisticRepo habitStatisticRepo,
                                     HabitRepo habitRepo,
                                     HabitService habitService, ModelMapper modelMapper,
                                     DateService dateService);

}