title: Setting up timeouts for every entry that are present in a HashMap
body: <p>I have a HashMap in which I want to do a specific action for an entry that is added in the HashMap after a time period.</p>
  
  <pre><code>HashMap&lt;K,V&gt; map = new HashMap&lt;&gt;();
  void addEntry(K,V) {
      //set timeout for the key-value pair to say 10 seconds
      map.put(K,V);
  }
  
  void actionAfterTimeout(K) {
      //do something
      map.remove(K);
  }
  </code></pre>
  
  <p>Say after the timeout occurs i want to do some processing and remove the entry from the map. How should I do it?</p>