title: Java - Remove duplicates from a string
body: <p>I have a string with a list of values separated by semicolon. I need some optimal method to remove duplicates. I have following regular expression:</p>
  
  <pre><code>\b(\w+);(?=.*\b\1;?)
  </code></pre>
  
  <p>This works, but it fails when there are white spaces. For example <code>aaa bbb;aaa bbb;aaa bbb</code> creates <code>aaa aaa aaa bbb</code> instead of <code>aaa bbb</code>.</p>