public static function objectSerialize($targetObject, $rootName)
    {
        Validate::notNull($targetObject, 'targetObject');
        Validate::isString($rootName, 'rootName');

        $container = new \stdClass();

        $container->$rootName = $targetObject;

        return json_encode($container);
    }