Multimapping and anonymous values
<p>I wish to create an instance of <code>TreeMap</code> whose keys will be of type <code>String</code> and values of 
type <code>ArrayList &lt;String&gt;</code>: </p>

<pre><code>Map&lt;String, List&lt;String&gt;&gt; directory = new TreeMap&lt;String, List&lt;String&gt;&gt;();  
String[] names = {"Anne","Ben","Charles","Dawn","Edward"};  

for (int i = 0; i &lt; names.length; i++) {  
    directory.put(names[i], new ArrayList&lt;String&gt;());  
}  
</code></pre>

<p>My question here relates to line 5 of the following code. Is it acceptable/best practice to pass an anonymous object (in this case given by new ArrayList()) as the actual argument to the put() method? My rationale for this is that by the nature of a map, these objects can still be reached by the following for example:</p>

<pre><code>directory.get("Anne");
</code></pre>
