public function testUnique()
 {
     $obj1 = new \stdClass();
     $obj1->id = 1;
     $obj1->data = 'a';
     $obj2 = new \stdClass();
     $obj2->id = 1;
     $obj2->data = 'b';
     $obj3 = new \stdClass();
     $obj3->id = 2;
     $obj3->data = 'c';
     $obj4 = new \stdClass();
     $obj4->id = '2';
     $obj4->data = 'd';
     $collection = new Collection([$obj1, $obj2, $obj3, $obj4]);
     $result = $collection->distinct(function ($obj) {
         return $obj->id;
     });
     $this->assertSame([0 => $obj1, 2 => $obj3, 3 => $obj4], $result->toArray(), 'uniqueness is based on strict callback value');
     $result = $collection->distinct();
     $this->assertSame([$obj1, $obj2, $obj3, $obj4], $result->toArray(), 'default flag is sort regular');
     $this->setExpectedException(\InvalidArgumentException::class);
     $collection->distinct('not valid argument');
 }