title: How do I keep the iteration order of a List when using Collections.toMap() on a stream?
body: <p>I am creating a <code>Map</code> from a <code>List</code> as follows:</p>
  
  <pre><code>List&lt;String&gt; strings = Arrays.asList("a", "bb", "ccc");
  
  Map&lt;String, Integer&gt; map = strings.stream()
      .collect(Collectors.toMap(Function.identity(), String::length));
  </code></pre>
  
  <p>I want to keep the same iteration order as was in the <code>List</code>. How can I create a <code>LinkedHashMap</code> using the <code>Collectors.toMap()</code> methods?</p>