Add a unit-test helper function