code: @SuppressWarnings(value = "unchecked")
    <T, K extends SharedResourceKey> T getAutoScoped(final SharedResourceFactory<T, K, S> factory, final K key,
        final SharedResourcesBrokerImpl<S> broker)
        throws ExecutionException {
  
      // figure out auto scope
      RawJobBrokerKey autoscopeCacheKey = new RawJobBrokerKey(broker.getWrappedSelfScope(), factory.getName(), key);
      ScopeWrapper<S> selectedScope = this.autoScopeCache.get(autoscopeCacheKey, new Callable<ScopeWrapper<S>>() {
        @Override
        public ScopeWrapper<S> call() throws Exception {
          return broker.getWrappedScope(factory.getAutoScope(broker, broker.getConfigView(null, key, factory.getName())));
        }
      });
  
      // get actual object
      return getScoped(factory, key, selectedScope, broker);
    }
docs: Get an object for the specified factory, key, and broker at the scope selected by the factory. {@link DefaultBrokerCache}
  guarantees that calling this method from brokers with the same leaf scope will return the same object.