Factor out the State tests.