Mock final classes with Mockito

One of the standard Mockito related questions I’ve come across is online is “Can we mock final classes with Mockito?”. The answer to this question since Mockito 2 was introduced is “Yes, we can.”. Example code This is the test I would like to be able to run: @ExtendWith(MockitoExtension.class) class PersonTest { @Mock PinProvider pinProvider; @Test public void shouldCreatePersonWithCorrectPin() { …