I think you do need to cast it, but it shouldn't be too bad:
Foo<Bar> mockFoo = (Foo<Bar>) mock(Foo.class);when(mockFoo.getValue()).thenReturn(new Bar());
I think you do need to cast it, but it shouldn't be too bad:
Foo<Bar> mockFoo = (Foo<Bar>) mock(Foo.class);when(mockFoo.getValue()).thenReturn(new Bar());