title: Java Map merge vs computeIfAbsent and computeIfPresent
body: <p>I have used compute method as well as merge method.
  However I am still not sure how merge method differs from compute methods.</p>
  
  <p>I was asked a question in interview to maintain a counter of hits for given list of IP addresses. It was a basic implementation of Map where key is the IP and value is the number of hits.</p>
  
  <p>I implemented it with computeIfAbsent method but that was not sufficient when the key is present so I had to change the implementation to use merge method.</p>
  
  <p>Can we say that merge is equivalent to using both compute methods at same time?</p>