This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I've been trying a few things with sets and comparators etc.
I also have an appropriate compareTo() method. I can't figure out why the first print statement prints false. However, if I were not to add, say a to the set, then the first line & the second line prints true.
Your implementation for compareTo is not complete. You checked only if two objects of type AggTuples are equals or not, but the implementation of compare To should be able to provide addtional info as which object should be inserted before another, because lements inside a treeSet should be sorted.