OutOfTime { public static void main(String[] args) throws Exception { Timer timer = new Timer(); timer.schedule(new ThrowTask(), 1); SECONDS.sleep(1); timer.schedule(new ThrowTask(), 1); SECONDS.sleep(5); }  static void main(String[] args);  }
@Test(expected = IllegalStateException.class) public void outOfTimeTest() throws Exception { OutOfTime time = new OutOfTime(); time.main(null); }