public function min(callable $func = null)
    {
        $min = null;
        $iterator = $this->getSelectIteratorOrInnerIterator($func);
        foreach ($iterator as $value) {
            if (!is_numeric($value) && !is_string($value) && !($value instanceof \DateTime)) {
                throw new UnexpectedValueException("min() only works on numeric values, strings and DateTime objects.");
            }

            if (is_null($min)) {
                $min = $value;
            } elseif ($min > $value) {
                $min = $value;
            }
        }

        if ($min === null) {
            throw new \RuntimeException("Cannot calculate min() as the Linq sequence contains no elements.");
        }

        return $min;
    }