private boolean groupInfoMatches ( Map < String , List < GroupInfo > > a , Map < String , List < GroupInfo > > b ) { if ( a == null && b == null ) { return true ; } boolean isMatch = false ; if ( a != null && b != null ) { if ( a . isEmpty ( ) && b . isEmpty ( ) ) { isMatch = true ; } else if ( a . size ( ) == b . size ( ) ) { for ( Entry < String , List < GroupInfo > > entry : a . entrySet ( ) ) { List < GroupInfo > otherList = b . get ( entry . getKey ( ) ) ; isMatch = ( otherList != null ) ; if ( ! isMatch ) { break ; } List < GroupInfo > thisList = entry . getValue ( ) ; isMatch = otherList . containsAll ( thisList ) && thisList . containsAll ( otherList ) ; if ( ! isMatch ) { break ; } } } } return isMatch ; }
Compares the keys and values of two group - info maps