public function reset()
    {
        foreach (array_keys($this->objectInstances) as $className) {
            if ($className !== self::class) {
                unset($this->objectInstances[$className]);
            }
        }
    }