title: How can I edit a List which is set as a Value inside of a Map? (Specific example; Java)
body: <p>Let's say I have a map like</p>
  
  <pre><code>Map&lt;Integer, List&lt;Integer&gt;&gt; map = new HashMap&lt;&gt;();
  </code></pre>
  
  <p>Inside the List there are numbers {10,21,35,42,50}.</p>
  
  <p>I would like to subtract each number with the following one e.g. 21-10, 35-21 and so on.</p>
  
  <p>The end goal is for the List to have {11, 14, 7, 8}.</p>
  
  <p>I'm having trouble with this because I don't know how to edit the List if it's set as a value.</p>
  
  <p>Thanks in advance.</p>