/** * This method is the same as binarySearch with the exception that a range * can be given in which shall be searched for the key. * * @param ListI $a * @param \blaze\lang\Reflectable $key * @param int $fromIndex The index where to start at in the array * @param int $toIndex The index where to stop at in the array * @param blaze\lang\Comparator $c * @return int * @throws blaze\lang\IndexOutOfBoundsException */ public static function binaryRangeSearch(ListI $a, \blaze\lang\Reflectable $key, \int $fromIndex, \int $toIndex, \blaze\lang\Comparator $c = null) { return Collections::binarySearch($a->subList($fromIndex, $toIndex), $key, $c); }
public function testSort() { // Remove the following lines when you implement this test. $list = $this->getList(); Collections::sort($list); $this->assertTrue(Collections::binarySearch($list, new \blaze\lang\Integer(98), null) == 7); }