def METHOD_NAME(self, state, shots, mocker):
    """Tests that the expectation of a ``Projector`` object is computed correctly for both of
    its subclasses."""
    dev = qml.device("default.qubit.legacy", wires=3, shots=shots)
    np.random.seed(42)
    @qml.qnode(dev)
    def circuit():
        qml.Hadamard(0)
        return qml.expval(qml.Projector(state, wires=range(3)))
    new_dev = circuit.device
    spy = mocker.spy(qml.QubitDevice, "expval")
    res = circuit()
    expected = [0.5, 0.5] if isinstance(shots, list) else 0.5
    assert np.allclose(res, expected, atol=0.02, rtol=0.02)
    custom_measurement_process(new_dev, spy)