title: Add new value if key already exists in HashMap
body: <p>I have a ArrayList>> with certain entries. Each entry has a "ID" which can be similar to other entries.</p>
  
  <p>I want to check if two(or more) entries have the same Id, then assign a color to them. If not then assign the next color and add the assigned color value the map.</p>
  
  <p>Here is my code:-</p>
  
  <pre><code>String[] colorPallete =new String[] {"#1F1A17", "#62934D", "#F9B03F", "#7959BC", "#74B8DE", "#E65641", "#7CC8BB", "#D7CE5D", "#D6BE95", "#B694D1"};
  
  
  
   map = new HashMap&lt;String,String&gt;();
   map.put(NEWSSOURCETITLE, title);
   map.put(DESCRIPTION, description);
   map.put(ID, newsId);
   myNewsList.add(map);
  </code></pre>
  
  <p>how can I achieve this?</p>