public function lookup($key) { $t = $this->search($key); if ($t->isEmpty()) { throw new \RuntimeException('Key not found in tree'); } return $t->value(); }