public function isDocumentInDocumentPool($document)
    {
        if ($document instanceof Document) {
            $document = $document->getId();
        }

        return isset($this->documentPool[(string) $document]);
    }