Write the following generic method using selection sort and a comparator:
public static <E> void selectionSort(E[] list,
Comparator<? super E> comparator)
Write a test program that creates an array of 10 GeometricObjects and invokes this method using the GeometricObjectComparator introduced in Listing 20.5 to sort the elements. Display the sorted elements. Use the following statement to create the array:
Geometric0bject[] 1ist1 $=$ \{new Circle(5), new Rectangle(4, 5),
new Circle(5.5), new Rectangle(2.4,5), new Circle(0.5),
new Rectangle(4,65), new Circle(4.5), new Rectangle $(4.4,1)$,
new Circle $(6.5)$, new Rectangle $(4,5)\}$;
Also in the same program, write the code that sorts six strings by their last character. Use the following statement to create the array:
String[] 1ist2 = \{"red", "b1ue", "green", "ye11ow", "orange",
"pink"\};