title: Java, collection with unique values
body: <p>I have a task to do for my classes. I need a collection to keep unique values, but java.util.Set is not enough for me. </p>
  
  <p>What I have to do - if I add words "dogs" and "cats" to collection and afterwards I try to add "dog" and "cat", in my collection will be only the "dogs" and "cats". </p>
  
  <p>If I add "ABCDEFG" and afterwards I try to add "BCDE", "DEFG", etc., it will not be added to my collection too.</p>
  
  <p>How can I write this code? </p>