public static boolean equal ( long [ ] x , long [ ] y ) { if ( x == null || y == null ) { return ( x == null ) && ( y == null ) ; } int p = Math . min ( x . length , y . length ) - 1 ; for ( int i = x . length - 1 ; i > p ; i -- ) { if ( x [ i ] != 0L ) { return false ; } } for ( int i = y . length - 1 ; i > p ; i -- ) { if ( y [ i ] != 0L ) { return false ; } } for ( ; p >= 0 ; p -- ) { if ( x [ p ] != y [ p ] ) { return false ; } } return true ; }
Test two bitsets for equality