Fix StubCache interface and unit tests for this class