public static function expected($expected, $code = 0)
    {
        if ($expected === null || is_string($expected)) {
            return new AnyException($expected, $code);
        }
        return $expected;
    }