ThreadLocalMillisProvider implements DateTimeUtils.MillisProvider { public static final void setCurrentMillisFixed(long fixedMillis) throws SecurityException { install(); local.set(new FixedMillisProvider(fixedMillis)); } private  ThreadLocalMillisProvider(); static final void setCurrentMillisSystem(); static final void setCurrentMillisFixed(long fixedMillis); static final void setCurrentMillisOffset(long offsetMillis); static final void setCurrentMillisProvider(DateTimeUtils.MillisProvider millisProvider); static void clear(); static DateTimeUtils.MillisProvider current(); @Override long getMillis();  }
@Test public void should_return_system_time_in_other_thread() throws Exception { final long now = System.currentTimeMillis(); ThreadLocalMillisProvider.setCurrentMillisFixed(now); Thread.sleep(10); final long[] fromOtherThread = new long[1]; collectCurrentTimeInThread(fromOtherThread, 0).join(); assertThat(fromOtherThread[0]).isNotEqualTo(now).isNotEqualTo(0); }