Clock { public long currentTimeMillis() { return System.currentTimeMillis(); }  long currentTimeMillis(); String currentTimeFormatted(String stdDateFormat);  }
@Test public void returns_system_time() throws Exception { Clock clock = new Clock(); long t1 = clock.currentTimeMillis(); Thread.sleep(50); long t2 = clock.currentTimeMillis(); Thread.sleep(50); long t3 = clock.currentTimeMillis(); assertThat("t3 should be greater", t3 > t2, equalTo(true)); assertThat("t2 should be greater", t2 > t1, equalTo(true)); }