Use TreeSet to remove duplicates from a file