Example #1
0
 @Test
 public void testNthElementDuplicates() {
   assertEquals(
       5, (int) Search.nthElement(new Integer[] {4, 5, 6, 7, 4, 4, 8, 1, 2, 9, 9, 1, 2}, 7));
 }
Example #2
0
 @Test
 public void testNthElementMatrix() throws Exception {
   assertEquals(16, (int) Search.nthElement(m, 6));
   assertEquals(1, (int) Search.nthElement(m, 0));
   assertEquals(50, (int) Search.nthElement(m, 11));
 }
Example #3
0
 @Test
 public void testNthElement() {
   assertEquals(5, (int) Search.nthElement(new Integer[] {4, 5, 6, 7, 8, 9, 1, 2}, 3));
 }