public static function wrap($bean, $modelClass = null)
    {
        if (is_array($bean)) {
            $collection = new Collection($bean);
            $collection->map(function ($item) use ($modelClass) {
                if ($modelClass) {
                    return new $modelClass($item);
                } else {
                    return new static($item);
                }
            });
            return $collection;
        } elseif ($bean instanceof OODBBean) {
            if ($modelClass) {
                return new $modelClass($bean);
            } else {
                return new static($bean);
            }
        } else {
            return $bean;
        }
    }