This is a convenient test helper for anything that can use injected streams. Extract this to where it can be used by other tests and add some basic tests, mostly documenting how it works.