def METHOD_NAME(self, pauli_op, is_summed_op):
    """Abelian grouper test"""
    if pauli_op == "h2_op":
        paulis = (
            (-1.052373245772859 * I ^ I)
            + (0.39793742484318045 * I ^ Z)
            + (-0.39793742484318045 * Z ^ I)
            + (-0.01128010425623538 * Z ^ Z)
            + (0.18093119978423156 * X ^ X)
        )
        num_groups = 2
    else:
        paulis = (
            (I ^ I ^ X ^ X * 0.2)
            + (Z ^ Z ^ X ^ X * 0.3)
            + (Z ^ Z ^ Z ^ Z * 0.4)
            + (X ^ X ^ Z ^ Z * 0.5)
            + (X ^ X ^ X ^ X * 0.6)
            + (I ^ X ^ X ^ X * 0.7)
        )
        num_groups = 4
    if is_summed_op:
        paulis = paulis.to_pauli_op()
    grouped_sum = AbelianGrouper().convert(paulis)
    self.assertEqual(len(grouped_sum.oplist), num_groups)
    for group in grouped_sum:
        for op_1, op_2 in combinations(group, 2):
            if is_summed_op:
                self.assertEqual(op_1 @ op_2, op_2 @ op_1)
            else:
                self.assertTrue(commutator(op_1, op_2).is_zero())