def METHOD_NAME(self, initial, expected):
    """Test correctly identifies index order"""
    with self.subTest("dense"):
        result = find_index_order(initial)
        self.assertEqual(result, expected)
    if _optionals.HAS_SPARSE:
        import sparse as sp  # pylint: disable=import-error
        with self.subTest("sparse"):
            result = find_index_order(sp.as_coo(initial))
            self.assertEqual(result, expected)