protected function doesContainsObjects(array $objects) : bool
    {
        $this->toOrderedMap();

        foreach ($objects as $object) {
            if ($object->hasId()) {
                if (!isset($this->identityMap[$object->getId()])) {
                    return false;
                }
            } else {
                if (!isset($this->instanceIdMap[$object])) {
                    return false;
                }
            }
        }

        return true;
    }