title: Inject empty map via spring
body: <p>In my @Configuration file, I have beans with a relationship similar to the following:</p>
  
  <pre><code>@Bean
  public Cache&lt;Foo,Bar&gt; fooBarCache(Map&lt;Foo,Future&lt;Bar&gt;&gt; refreshTaskMap) {
      return new AsyncUpdateCache(refreshTaskMap);
  }
  
  @Bean
  public Map&lt;Foo,Future&lt;Bar&gt;&gt; refreshTaskMap() {
      return new HashMap&lt;Foo,Future&lt;Bar&gt;&gt;();
  }
  </code></pre>
  
  <p>However, the ApplicationContext fails to load because it complains about "No qualifying bean of type [com.example.Bar]". From what I can tell, Spring is trying to be cute with creating a map for me and assumes I intend to use the map to lookup beans, or something similar.</p>
  
  <p>How do I prevent it from trying to do its collection-injection "magic" and just inject the bean as I've declared it? I've tried adding a @Qualifier annotation on the fooBarCache argument, but that didn't seem to help.</p>