I have a nice problem - **create a phone book** - containing list of contacts.
As a phonebook goes,
1. Contacts are to be always sorted.(by name)
2. Can star mark certain contacts, so they have to be above all the rest.(the * contacts are ordered by the time of contact creation)
1. The contains doesn't find the entry anymore, what's amiss?
I did try and put an equals and a hashcode on Contact, apparently, if there is a Comparator/Comparable present, the compare* is only invoked.
2. Is it fair to use a TreeSet here, or should any other datastructure be used?
For eg. HashSet and then convert to a TreeSet?
3. The contains() doesn't even compare for all entries in the map, it just compared against C,Ma and Ta entries. Why was that?
Questions priority according to order.