Is it possible to create a map where the key is a Collection (any sort of collection)?
If I try it on most common collections I'm told the collection can't be cast to comparable.
I've been trying to write a compareTo function for a custom collection, but I am struggling.
Either I need to write the compareTo, or I need to find a premade Map that accepts collections/Collection accepted by Maps.
How can I use a collection as a key on a map? I've looked over Stack overflow and I've googled this problem several times, but I've never found a solid solution!
The reason I want to do this is that I've written a 'shuffle' simulation in Java that mimic card shuffling. I want to be able to count up the number of times a specific hand (modeled as a collection) comes up. It would look something like this:
H4,C3,D2: 8
H9,D6,S11: 10
......