public static function apply($object, array $values)
    {
        foreach ($values as $property => $value) {
            // Check if the value is a map (associative array) by checking for
            // a zero index.
            if (is_array($value) and ! isset($value[0])) {
                $method = "get".ucfirst($property);

                if (method_exists($object, $method)) {
                    //$object->{$method}()->apply( $value );
                    static::apply($object->{$method}(), $value);
                }
            } elseif (is_array($value) and isset($value[0])) {
                // Check if the value is a collection, i.e. an indexed array. If this
                // is the case then the $value is an interable array. If the object
                // has an "add" method for the property then we call this x times.
                $method = "add".ucfirst($property);

                if (method_exists($object, $method)) {
                    foreach ($value as $arguments) {
                        if (! is_array($arguments)) {
                            $arguments = array( $arguments );
                        }

                        call_user_func_array(array( $object, $method ), $arguments);
                    }
                }
            } else {
                // Check if the value has a corresponding setter method
                // on the object.
                $method = "set".ucfirst($property);

                if (method_exists($object, $method)) {
                    $object->{$method}($value);
                }
            }
        }
    }