Quantcast
Channel: Using Mockito to mock classes with generic parameters - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by Tobias Uhmann for Using Mockito to mock classes with generic parameters

$
0
0

I agree that one shouldn't suppress warnings in classes or methods as one could overlook other, accidentally suppressed warnings. But IMHO it's absolutely reasonable to suppress a warning that affects only a single line of code.

@SuppressWarnings("unchecked")Foo<Bar> mockFoo = mock(Foo.class);

Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>