Clock { public void reset() { startTime = System.currentTimeMillis(); update(); } Clock(); String update(); void reset();  }
@Test public void testReset() { try { instance.update(); Thread.sleep( 1000 ); instance.update(); } catch ( InterruptedException ex ) { Logger.getLogger( ClockTest.class.getName() ).log( Level.SEVERE, null, ex ); } String preResult = instance.update(); instance.reset(); String result = instance.update(); if ( result.equals( "0" ) && !preResult.equals( "0" ) ) { assertTrue( true ); } else { assertTrue( false ); } }