BehaviourDrivenCode

public class TimerSpec {
    public void shouldMeasureAPeriodOfTime() throws Exception {
        // setup
        Timer timer = new Timer();
        timer.start();

        // execute
        // TODO make this not time-dependent - could possibly fail
        Thread.sleep(10);
        timer.stop();
        // verify
        Verify.that(timer.elapsedTimeMillis() > 0);
    }
}