private function loadAllObjects(): array
    {
        if (!file_exists($this->databaseFilePath)) {
            return [];
        }

        $objects = Serializer::deserialize("{$this->className}[]", file_get_contents($this->databaseFilePath));

        Assertion::allIsInstanceOf($objects, $this->className);

        return $objects;
    }