### Question:
StopWatch extends Stated { public long getStartTime() { if(!isStarted()) { throw new IllegalStateException("not started"); } return timeStamp; } StopWatch(); long getStartTime(); long lap(); long getTime(); void resetClock(); void resetTime(); void onReset(); void add(long nanos); void add(StopWatch stopWatch); @Override String toString();  }### Answer:
@Test(expected = IllegalStateException.class) public void testGetStartTimeWhenStopped() { stopWatch.stop(false); Assert.assertFalse(stopWatch.isStarted()); stopWatch.getStartTime(); }
@Test public void testGetStartTimeWhenStarted() { long timeStamp = System.nanoTime(); stopWatch.start(); Assert.assertTrue(stopWatch.isStarted()); long startTime = stopWatch.getStartTime(); Assert.assertTrue(startTime > timeStamp); Assert.assertTrue(startTime < timeStamp + TimeUnit.NANOSECONDS.convert(10, TimeUnit.MILLISECONDS)); }