TimeUtils { public long nowInUnixTime() { return clock.currentTimeMs() / 1000; } TimeUtils();  TimeUtils(Clock clock); long nowInUnixTime();  }
@Test public void returnsCurrentUnixTime() { long expCurrentUnixTime = 12345678L; TimeUtils tu = new TimeUtils(new FixedClock(expCurrentUnixTime * 1000)); assertThat(tu.nowInUnixTime()).isEqualTo(expCurrentUnixTime); }