$ 0 0 why not using spyvar mock = spy(new Foo<Bar>());when(mockFoo.getValue()).thenReturn(new Bar());