public function indexOf($filter)
    {
        foreach ($this->children as $i => $child) {
            if ($child === $filter) {
                return $i;
            }
        }

        return -1;
    }