@Override
    protected Duration available() {
        Interval outer = new Interval(period.getEnd().minusWeeks(1), period.getEnd());

        Duration aDay = new Duration(24 * hoursToMillis);
        int overtime = intervals.countDurationInterval(outer, aDay, max);

        Duration dayMax;

        if (overtime < 2) {
            dayMax = Drive.OVERTIME.getValue();
        } else {
            dayMax = max;
        }

        if (driving.isShorterThan(dayMax)) {
            return dayMax.minus(driving);
        } else {
            return new Duration(0);
        }
    }