Sleeper { @SuppressWarnings("checkstyle:designforextension") public void sleep(final long duration) throws InterruptedException { TimeUnit.MILLISECONDS.sleep(duration); }  @SuppressWarnings("checkstyle:designforextension") void sleep(final long duration);  }
@Test public void should_sleep() throws InterruptedException { long before = System.currentTimeMillis(); new Sleeper().sleep(1000); long after = System.currentTimeMillis(); long diff = after - before; assertTrue(diff >= 1000); }