Long term it would be nice to replace our calls to internal Mockito code to only use their public API (see [this comment](https://github.com/spring-projects/spring-boot/issues/10245)). This should be easier once #10247 has been fixed.