title: Which data structure to use for keeping a list unique with insertion order intact
body: <p>I need to add objects to a list (with <code>List</code> semantics) while keeping all objects in the list unique. I figured <code>LinkedHashSet</code> would do, but the "re-insert" clause breaks this:</p>
  
  <pre><code>LinkedHashSet&lt;String&gt;list = new LinkedHashSet&lt;String&gt;();
  list.add("a");
  list.add("b");
  list.add("c");
  list.add("a");
  list.add("a");
  System.out.println (list);
  </code></pre>
  
  <p>Output from the above is: <code>[a, b, c]</code>, not <code>[b, c, a]</code> as I would like it.</p>
  
  <p>Is there any such data-structure in Java which handles this case?</p>