some utility code for unit tests