private static boolean compareOrdered ( DualKey dualKey , LinkedList < DualKey > stack , Collection visited ) { Collection col1 = ( Collection ) dualKey . _key1 ; Collection col2 = ( Collection ) dualKey . _key2 ; if ( ProxyHelper . isProxyCollection ( col1 ) || ProxyHelper . isProxyCollection ( col2 ) ) { return false ; } if ( col1 . size ( ) != col2 . size ( ) ) { return false ; } Iterator i1 = col1 . iterator ( ) ; Iterator i2 = col2 . iterator ( ) ; while ( i1 . hasNext ( ) ) { DualKey dk = new DualKey ( i1 . next ( ) , i2 . next ( ) ) ; if ( ! visited . contains ( dk ) ) { stack . addFirst ( dk ) ; } } return true ; }
Compare two Collections that must be same length and in same order .