def METHOD_NAME(self, obs):
    """Tests if coefficients are properly re-structured even if the same
    terms appear multiple times.
    Although it should be fair to assume that the terms are unique in the
    Hamiltonian, making sure that grouping happens even with terms appearing
    multiple times can ensure that there is no unexpected behaviour.
    """
    coefficients = [1.43, 4.21]
    grouped_coeffs_sol = [[1.43, 4.21]]
    grouped_coeffs = optimize_measurements(
        obs, coefficients, grouping="qwc", colouring_method="rlf"
    )[2]
    assert len(grouped_coeffs) == len(grouped_coeffs)
    assert all(
        np.allclose(grouped_coeffs[i], grouped_coeffs_sol[i])
        for i in range(len(grouped_coeffs_sol))
    )