public function getDay(Month $month, $dayNo)
    {
        $dayNo = (int) $dayNo;

        if (null === $this->dayProvider) {
            return new Day($month, $dayNo);
        }

        $day = $this->dayProvider->createDay($month, $dayNo);

        if (!$day instanceof DayInterface) {
            throw new DomainException(
                '$day must be instance of BmCalendar\DayInterface; got '
                . is_object($day) ? get_class($day) : gettype($day)
            );
        }

        if ($day->value() !== $dayNo) {
            throw new DomainException(
                "The value of the day is wrong, it should be $dayNo but is actually "
                . $day->value()
            );
        }

        if ($day->getMonth() !== $month) {
            throw new DomainException(
                'The day returned from the day provider contains the wrong Month.'
            );
        }

        return $day;
    }