this is such a common pattern - don't suppose there's a test helper function for it?