Use mockito 5 to mock calls made to the constructor and return a mock.
This article covers upgrading from Mockito 4 to Mockito 5.
Using Mockito to inject mock dependencies into classes.
Mocking a Record using Mockito
In this article, we take a look at how to let a thread sleep for given time.
In this article, we take a look at how to interrupt a thread.