Helper function in tests.