title: Convert List to Map in java 8 by appending values for a key if exists
body: <p>I am trying to convert a List to map. if the key exists i just want to combine two values and separate them by "," and assign it to the key. If the key doesn't exist, i just want to assign directly as a key value pair and i want to use streams for this purpose.</p>
  
  <p>Example:</p>
  
  <pre><code>List&lt;Object&gt; listObject = {something1,something2,something3}
  Map&lt;String,String&gt; listToMap = listObject.stream().collect(Collectors.toMap(listObject::getKey,listObject::getValue))
  </code></pre>
  
  <p>The above will error out if there any duplicate keys. Any suggestions are helpful here.</p>