@Test public void testSearchKeyCase4() { int[] arr = {6, 7, 1, 2, 3, 4, 5}; int key = 5; int actual = RotatedSortedArraySearch.searchKey(arr, key); int expected = 6; assertEquals(actual, expected); }
@Test public void testSearchKeyNotExists() { int[] arr = {7, 1, 2, 3, 4, 5, 6}; int key = 0; int actual = RotatedSortedArraySearch.searchKey(arr, key); int expected = -1; assertEquals(actual, expected); }