* @throws Exception If an unexpected error occurs.
*/
@Test
public void testClockOffset() throws Exception {
// A clock with a date/time which is always 1 hour behind the current system date/time, in UTC
Clock clock = Clock.offset(Clock.systemUTC(), Duration.ofHours(-1));
Thread.sleep(1);
long currentTimeMillis = Instant.now().toEpochMilli();
// The offset clock should return a date/time, behind the current date/time
assertThat(clock.instant().toEpochMilli(), lessThan(currentTimeMillis));
}