private function assertContainsStone(array $stones, Dto\Stone $stone) { $containsStone = array_reduce($stones, function ($carry, Dto\Stone $other) use($stone) { return $carry || $stone->getTopValue() === $other->getTopValue() && $stone->getBottomValue() === $other->getBottomValue(); }, false); $this->assertTrue($containsStone, 'expected to find stone in stone collection'); }