protected function validateGroup(SwatTileViewGroup $group)
    {
        // note: This works because the id property is set before children are
        // added to parents in SwatUI.
        if ($group->id !== null) {
            if (array_key_exists($group->id, $this->groups_by_id)) {
                throw new SwatDuplicateIdException(
                    "A group with the id '{$group->id}' already exists " .
                        'in this tile view.',
                    0,
                    $group->id
                );
            }
        }
    }