private function removeCurrentNode()
{
if ($this->right->isEmpty() && $this->left->isEmpty()) {
return self::createEmpty();
}
if ($this->right->isEmpty() && !$this->left->isEmpty()) {
return $this->left;
}
if (!$this->right->isEmpty() && !$this->left->isEmpty()) {
return $this->right;
}
return $this->removeLastAndPlaceAtTheTop();
}