I am creating a class that implements java.util.List. My class is using E to represent the parameterized type.
I want to call Collections.sort to sort the internal list I’m wrapping with my class. The problem is that this requires my list to have types that implement comparable.
Like the sort method, I want to be able to take a comparator, so I don’t want to force E to be a subclass of Comparable. So, in the constructor that doesn’t take a comparator, I want to verify that E implements Comparable.
So, how do I do this, O mighty java wizards?
No good way to do this. Just closing and moving on.