public static function clearExcept(array $keepInstanceNames)
    {
        foreach (self::$instances as $name => $instance) {
            if (!in_array($name, $keepInstanceNames)) {
                self::clear($name);
            }
        }
    }