question: @ Override public int compareTo ( FrequentItemSet o ) { Collection < Item > hisItems = o . getItems ( ) ; if ( items . size ( ) < hisItems . size ( ) ) { return - 1 ; } else if ( items . size ( ) > hisItems . size ( ) ) { return 1 ; } else { Iterator < Item > iterator = hisItems . iterator ( ) ; for ( Item myCurrentItem : this . items ) { int relation = myCurrentItem . compareTo ( iterator . next ( ) ) ; if ( relation != 0 ) { return relation ; } } return 0 ; } }
target:  This method compares FrequentItemSets. It first compares the length of items sets, then the items itself. If they are the same, the Sets are equal.