Java: How to convert a list to HashMap (key being the list) in one line : <p>I have an arraylist of Strings:</p>

<pre><code>ArrayList&lt;String&gt; list = Arrays.asList("A", "B", "C", "D");
</code></pre>

<p>I would like to initialize a map <code>HashMap&lt;String, List&lt;Integer&gt;&gt;</code> with the element of my list being the key and an empty list of integers being the value.</p>

<p>Of course there is a way to do it using a loop, but I wonder whether there is a way to do it in one line. After seeing the questions and answers in <a href="https://stackoverflow.com/questions/8261075/adding-multiple-entries-to-a-hashmap-at-once-in-one-statement">a similar question</a>, I am aware that it is doable by:</p>

<pre><code>HashMap&lt;String, List&lt;Integer&gt;&gt; bigMap = ImmutableMap.&lt;String, List&lt;Integer&gt;&gt;builder()
.put("A", new ArrayList&lt;Integer&gt;)
.put("B", new ArrayList&lt;Integer&gt;)
.put("C", new ArrayList&lt;Integer&gt;)
.put("D", new ArrayList&lt;Integer&gt;)
.build();
</code></pre>

<p>But that only applies to the scenario that the size of the list is small. How can I do it using stream, like the way mentioned in <a href="https://stackoverflow.com/questions/4138364/java-how-to-convert-list-to-map">another question</a>?</p>
