test ( ) { int [ ] IDENT_0 = new int [ ] { 4 , 5 , 6 , 7 , 0 , 1 , 2 } ; int target = 0 ; "<AssertPlaceHolder>" ; } search ( int [ ] , int ) { int IDENT_1 = 0 ; int IDENT_2 = ( IDENT_0 . length ) - 1 ; while ( IDENT_1 < IDENT_2 ) { int IDENT_3 = ( IDENT_1 + IDENT_2 ) / 2 ; if ( ( IDENT_0 [ IDENT_3 ] ) == target ) { return IDENT_3 ; } if ( ( IDENT_0 [ IDENT_1 ] ) <= ( IDENT_0 [ IDENT_3 ] ) ) { if ( ( target >= ( IDENT_0 [ IDENT_1 ] ) ) && ( target < ( IDENT_0 [ IDENT_3 ] ) ) ) { IDENT_2 = IDENT_3 - 1 ; } else { IDENT_1 = IDENT_3 + 1 ; } } else { if ( ( target > ( IDENT_0 [ IDENT_3 ] ) ) && ( target <= ( IDENT_0 [ IDENT_2 ] ) ) ) { IDENT_1 = IDENT_3 + 1 ; } else { IDENT_2 = IDENT_3 - 1 ; } } } return ( IDENT_0 [ IDENT_1 ] ) == target ? IDENT_1 : - 1 ; }
org . junit . Assert . assertThat ( search ( IDENT_0 , target ) , org . hamcrest . Matchers . is ( 4 ) )