treeset replaces hashset, printwriter set up, but iterator not working