@@ -0,0 +1,719 @@
+import java.util.HashSet;%0Aimport java.util.TreeSet;%0Aimport java.util.Set;%0Aclass ConvertHashSettoTreeSet%7B %0A  public static void main(String%5B%5D args) %7B%0A     // Create a HashSet%0A     HashSet%3CString%3E hset = new HashSet%3CString%3E();%0A %0A     //add elements to HashSet%0A     hset.add(%22Element1%22);%0A     hset.add(%22Element2%22);%0A     hset.add(%22Element3%22);%0A     hset.add(%22Element4%22);%0A %0A     // Displaying HashSet elements%0A     System.out.println(%22HashSet contains: %22+ hset);%0A %0A     // Creating a TreeSet of HashSet elements%0A     Set%3CString%3E tset = new TreeSet%3CString%3E(hset);%0A %0A     // Displaying TreeSet elements%0A     System.out.println(%22TreeSet contains: %22);%0A     for(String temp : tset)%7B%0A        System.out.println(temp);%0A     %7D%0A  %7D%0A%7D%0A

Create ConvertHashSettoTreeSet.java