def METHOD_NAME(self, item: T, parent_fn: Callable[[T], Optional[T]]):
    current: T = item
    assert current
    segment: Optional[Node[T]] = None
    key: str = self._key_fn(current) if self._key_fn else current  # type: ignore
    if key in self:
        return
    while True:
        old_segment = segment
        segment = Node(current)
        if old_segment:
            segment.add(old_segment)
        parent = parent_fn(current)
        if parent is None:
            anchor_point = self.root
        else:
            parent_key: str = self._key_fn(parent) if self._key_fn else parent  # type: ignore
            anchor_point = self.get(parent_key, None)
        if anchor_point:
            self.insert_segment(anchor_point, segment)
            return
        current = parent_fn(current) or self.root.data