Mocks are a useful testing tool. We can provide "empty" objects, so we don't have to initialise the whole application to test a section, and we can use mocks to check our code is making the calls we expect.
Stub objects allow us to state from a test what values get injected into our application code. They can provide simple interfaces, so we don't have to initialise the whole application to test a section.
The latest versions of Java contain "Preview Features", features that are fully functional but require developer feedback. Try them out in IntelliJ IDEA.