Structs

Custom handler storing all the messages it received, so they can be later verified. State is thin shared state, so it can be hold after mock is passed to App to read state.
Internal state of CachingCustomHandler wrapping internal mutability so it is not exposed to user. Those have to be shared internal state, as after mock is passed to app it is not possible to access mock internals which are not exposed by API.