public static function isInstanceOf($value, $class, $message = null)
    {
        if (!$value instanceof $class) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected instance of %2$s, but got %s',
                Helper::typeToString($value),
                $class
            ));
        }
    }