### Question:
Stopwatch { public long elapsedNanos() { if (running) { return this.ticks.ticks() - start; } else { if (elapsed == -1) throw new IllegalStateException(); return elapsed; } } Stopwatch(Ticks ticks); long elapsedNanos(); void start(); void stop(); final static Ticks SYSTEM_TICKS; }### Answer:
@Test(expected = IllegalStateException.class) public void testNotStarted1() { FakeTicks f = new FakeTicks(); Stopwatch s = new Stopwatch(f); s.elapsedNanos(); }