Matthew Sessoms wrote:Sure, thanks for the reply.
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.
This is a possible implementation of compareTo: