### Question:
Stopwatch { public void start() { if (running) throw new IllegalStateException(); start = ticks.ticks(); running = true; } Stopwatch(Ticks ticks); long elapsedNanos(); void start(); void stop(); final static Ticks SYSTEM_TICKS; }### Answer:
@Test(expected = IllegalStateException.class) public void testTwiceStarted() { FakeTicks f = new FakeTicks(); Stopwatch s = new Stopwatch(f); s.start(); s.start(); }