title: Which one is better getOrDefault() or putIfAbsent() of HashMap in Java
body: <p>If I have to set values for a key (for many keys) in HashMap if not present then which one is better to use. 
  <strong>getOrDefault() or putIfAbsent()</strong>
  As both the method will return the value associated with the key if it is already set.
  And both will take key,value pair as parameter.</p>