protected boolean stepsEqual ( WalkingIterator iter1 , WalkingIterator iter2 , int numSteps ) { AxesWalker aw1 = iter1 . getFirstWalker ( ) ; AxesWalker aw2 = iter2 . getFirstWalker ( ) ; for ( int i = 0 ; ( i < numSteps ) ; i ++ ) { if ( ( null == aw1 ) || ( null == aw2 ) ) return false ; if ( ! aw1 . deepEquals ( aw2 ) ) return false ; aw1 = aw1 . getNextWalker ( ) ; aw2 = aw2 . getNextWalker ( ) ; } assertion ( ( null != aw1 ) || ( null != aw2 ) , "Total match is incorrect!" ) ; return true ; }
Compare a given number of steps between two iterators to see if they are equal .