Recently got caught up into testing of SCStream and other related types, e.g. SCDisplay, SCRunningApplication. Interestingly many of these types have unavailable initializer, so, there is no straight forward way to mock these types.
However, as long as those are NSObject types, there is a quick workaround. We can use NSObject metatype to bypass the restrictions. 🙃For example, take a look at working mock of SCDisplay. **Do not do this in production code**