Util methods for tests.