Add a new java.time.Clock attribute to the tested class MyService and make sure the new attribute will instantiatebe initialized properly at default values with an instantiation block or a constructor:
import java.time.Clock; import java.time.LocalDateTime; public class MyService { // (...) private Clock clock; public Clock getClock() { return clock; } public void setClock(Clock newClock) { clock = newClock; } public void initDefaultClock() { setClock( Clock.system( Clock.systemDefaultZone().getZone() // You can just as well use // java.util.TimeZone.getDefault().toZoneId() instead ) ); } { initDefaultClock(); // instantiationinitialisation in an instantiation block, but // it can be done in a constructor just as well } // (...) }