title: How to remove duplicate list from hashmap which is added as values
body: <p>Below is the program which has hashmap and adding list as keys. However duplicate list are being added. Now i want to remove all the duplicate list inside residing as values.</p>
  
  <pre><code>import java.util.*;
  public class Test {
  
  public static void main(String args[]) {
  
      Map&lt;String, List&lt;Integer&gt;&gt; sample = new HashMap&lt;String, List&lt;Integer&gt;&gt;();
      List  first = new ArrayList();
      first.add(1);
      first.add(2);
      first.add(3);
      List second = new ArrayList();
      second.add(4);
      second.add(5);
      second.add(6);
      List  third = new ArrayList();
      third.add(1);
      third.add(2);
      third.add(3);
      sample.put("first", first);
      sample.put("second", second);
      sample.put("third", third);
      System.out.print(sample.size()); // Prints 3
  
      // Need to Remove the duplicate lists
      // Expects two keys with list first and second since third is duplicate value
      // 1,23 and 4,5,6 instead of 1,2,3 4,5,6 and 1,2,3
  }
  }
  </code></pre>