title: Filter out items from Set in Java
body: <p>I have a list of items(i.e Strings) which I need to sort/filter.</p>
  
  <p>The end result should <em>not</em> contain any duplicate (easy), I'll put them all in the Set. So I have a Set of strings now.</p>
  
  <p>more explanation.. </p>
  
  <p>I also have a method x that calculates the amount of difference between two Strings (using levenstein distance). </p>
  
  <p><strong>Question:</strong></p>
  
  <p>Before inserting new String <code>string</code> into my Set <code>set</code> I want to check for <em>levenstein distance</em> using method <code>x</code> between <code>string</code> and any other String in the <code>set</code> and if <code>x</code> returns <code>&gt;=3</code> than I should not add it.</p>
  
  <p>What is my best shot of doing this? Except iterate trough <code>set</code> for each <code>string</code> to be inserted?</p>