So I am trying to make a general utility function for sorting Lists of various types (mostly built-in wrappers, and Strings). The sample code is below:
public void sortArrays(List<?>... arr) {
// do here
}
And it may be used as follows
List<Integer> a = // initialization
List<String> b = // initialization
...
sortArrays(a, b)
The function will sort varargs List and I'm planning to use Collections.sort(...) but unfortunately, it does not work on List of capture ofs. Is there a proper workaround or approach to what I'm trying to achieve?