StopWatch implements IStopWatch { void tick() { itsTime++; for (IStopWatchListener listener : itsListeners) listener.onTimeChange(itsTime); } StopWatch();  StopWatch(int initialTime); @Override void addListener(IStopWatchListener listener); @Override int getTime(); @Override void removeListener(IStopWatchListener listener); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testTick() { int time = itsStopWatch.getTime(); itsStopWatch.tick(); assertEquals(time + 1, itsStopWatch.getTime()); }