I'll move this method to a test util class and make it more generic.