public function prepend(?Node $node): bool {
        if ($node === null) {
            return false;
        }
        /*
         * need to clone the object otherwise the object
         * references are going crazy.
         *
         * Furthermore, setting previous and next to null
         * as they will be set later.
         */
        $newNode = clone $node;
        $newNode->setPrevious(null);
        $newNode->setNext(null);

        if ($this->getHead() === null) {
            $this->setHead($newNode);
            return true;
        }
        $head = $this->getHead();
        $head->setPrevious($newNode);
        $newNode->setNext($head);
        $this->setHead($newNode);
        return true;
    }