private boolean conditionsEqual ( Collection < Condition > conditions ) { if ( conditions . size ( ) != _conditions . size ( ) ) { return false ; } List < Condition > unvalidatedConditions = new ArrayList <> ( conditions ) ; for ( Condition condition : _conditions ) { if ( ! unvalidatedConditions . remove ( condition ) ) { return false ; } } return true ; }
The order of the conditions is irrelevant just check the set is the same .