News for hackers. Stuff that matters.
Re:Ask HN: What is a modern Java environment? by thedougd on Tuesday March 29, 2022 @06:55PM (#30849380)
I prefer to skip the mocking frameworks and rely on Interfaces instead. My unit tests create anonymous inner classes that are passed to the constructors.

If it takes too much effort to write that anonymous inner class, then the Interface may be too big and need broken up. Or maybe you're hiding too much state and need to rethink the API.

There are no comments on this comment yet.