[java] Removing duplicates from a String in Java