My code accepts the interface as input, but only implements several interface methods (often, just getters).
When testing the code, I would like to define an anonymous inner class that returns test data. But what should I do with all the other methods that the interface requires?
I could use my IDE to automatically create a stub for the interface, but it looks pretty hard.
What is the easiest way to drown out the two methods that I care about and none of the methods that I do?
source
share