Ejemplo n.º 1
0
 /**
  * Sorts the list.
  * The comparator can only be used for lists which manage objects.
  */
 public static function sort(ListI $list, \blaze\lang\Comparator $c = null)
 {
     Collections::sortRange($list, 0, $list->count() - 1, $c);
 }
Ejemplo n.º 2
0
 public function testSwap()
 {
     // Remove the following lines when you implement this test.
     $list = $this->getList();
     Collections::swap($list, 0, 7);
     $this->assertTrue($list->get(0)->equals(new \blaze\lang\Integer(67)));
     $this->assertTrue($list->get(7)->equals(new \blaze\lang\Integer(5)));
 }