protected function getInstances($id, $interface)
    {
        if (isset($this->instances[$id])) {
            return $this->instances[$id];
        }

        $this->instances[$id] = [];

        if (! $this->hasOption($id)) {
            return $this->instances[$id];
        } else {
            foreach ($this->getOption($id) as $instance) {
                if (is_a($instance, $interface, true)) {
                    $this->instances[$id][] = new $instance();
                }
            }
        }
        return $this->instances[$id];
    }