public function testThatCollectionCanBeFilteredByProperties()
 {
     $items = [["a" => 1, "c" => 3], ["a" => 1, "b" => 2], ["a" => 1, "b" => 2, "c" => 3], ["a" => 2, "b" => 2], null];
     //Test that invalid match type throws exception
     try {
         CollectionUtility::filterWhere($items, [], "Asdf");
         $this->fail("Expected exception for invalid match type");
     } catch (\InvalidArgumentException $e) {
     }
     //Test single property filtering
     $filtered = CollectionUtility::filterWhere($items, ["a" => 1]);
     $this->assertCount(3, $filtered);
     //Test multi property filtering
     $filtered = CollectionUtility::filterWhere($items, ["a" => 1, "b" => 2]);
     $this->assertCount(2, $filtered);
     //Test "OR" filtering
     $filtered = CollectionUtility::filterWhere($items, [["a" => 1, "b" => 2], ["a" => 2]], null);
     $this->assertEquals([["a" => 1, "b" => 2], ["a" => 1, "b" => 2, "c" => 3], ["a" => 2, "b" => 2]], $filtered);
     //Test key preservation for assoc arrays
     $assoc_items = ["A" => $items[0], "B" => $items[1], "C" => $items[2], "D" => $items[3]];
     $filtered = CollectionUtility::filterWhere($assoc_items, [["a" => 1, "b" => 2], ["a" => 2]], null);
     $this->assertEquals(["B" => ["a" => 1, "b" => 2], "C" => ["a" => 1, "b" => 2, "c" => 3], "D" => ["a" => 2, "b" => 2]], $filtered);
     //Test forced key preservation for non assoc arrays
     $filtered = CollectionUtility::filterWhere($items, [["a" => 1, "b" => 2], ["a" => 2]], null, true);
     $this->assertEquals([1 => ["a" => 1, "b" => 2], 2 => ["a" => 1, "b" => 2, "c" => 3], 3 => ["a" => 2, "b" => 2]], $filtered);
     //Test case sensitivity
     $items = [["a" => "B"], ["a" => "b"], ["c" => "d"]];
     $filtered = CollectionUtility::filterWhere($items, ["a" => "b"], CollectionUtility::MATCH_TYPE_CASE_INSENSITIVE);
     $this->assertCount(2, $filtered);
     $filtered = CollectionUtility::filterWhere($items, ["a" => "b"]);
     $this->assertCount(1, $filtered);
     //Test strict match
     $items = [["a" => 1], ["a" => "1"]];
     $filtered = CollectionUtility::filterWhere($items, ["a" => "1"], CollectionUtility::MATCH_TYPE_STRICT);
     $this->assertEquals([["a" => "1"]], $filtered);
     $filtered = CollectionUtility::filterWhere($items, ["a" => "1"]);
     $this->assertCount(2, $filtered);
 }