public function test_that_clone_includes_linked_nodes() { $tree = new RedBlackSearchTree(new ComparableComparator()); foreach ($this->getWeekDays() as $value => $key) { $tree->set($key, $value); } $copy = clone $tree; while (!$tree->isEmpty()) { $tree->removeMin(); } $this->assertCount(7, $copy); }
/** * {@inheritdoc} */ public function isEmpty() : bool { return $this->tree->isEmpty(); }