title: Convert List of Maps to single Map via streams
body: <p>I query the DB for two columns where the first one is the key to the second one.
  How can I convert the resulting list to a single map?
  Is it even possible? I have just seen examples with beans.</p>
  <pre><code>List&lt;Map&lt;String, Object&gt;&gt; steps = jdbcTemplate.queryForList(
          &quot;SELECT key, value FROM table&quot;);
  
  // well this doesn't work
  Map&lt;String, String&gt; result = steps.stream()
          .collect(Collectors.toMap(s -&gt; s.get(&quot;key&quot;), s -&gt; s.get(&quot;value&quot;)));
  </code></pre>