Helper methods.

Helper methods to simplify tests.