I'd be tempted to move this into some sort of test utility, rather than make it available in the main api. I can't think of any reason other than unit tests to use this.