title: How does Spring inject list as constructor argument
body: <p><strong>I've got</strong> this:</p>
  
  <pre><code>@Named
  @Singleton
  public class MyDefaultDef {
  
    @Inject
    public MyDefaultDef(SomeRef someRef, List&lt;AnotherRef&gt; anotherRefs) {
      //...
    }
    //...
  }
  </code></pre>
  
  <p><strong>Question1: [main]</strong> <em>How does work autowiring of <code>List&lt;AnotherRef&gt; anotherRefs</code> as a constructor arg?</em></p>
  
  <p>I mean if I'd like to replace that bean definition with xml, I had to specify each element of the list. I.e. </p>
  
  <pre><code>&lt;constructor-arg&gt;
    &lt;list&gt; 
       &lt;ref bean="..."/&gt;
       &lt;ref bean="..."/&gt;
    &lt;/list&gt; 
  &lt;/constructor-arg&gt;
  </code></pre>
  
  <p>But from where Spring takes those elements in case of annotations?</p>
  
  <p><strong>Question2:</strong> <em>How to replace <code>MyDefaultDef</code> bean definition to xml?</em></p>