Utilities useful when writing unit tests.