Added a couple of utility functions for unit testing