Code example for Stopwatch

0
 
   private Stopwatch stopwatch;
 
   @BeforeMethod 
   public void setUp() { 
      stopwatch = new Stopwatch();
   } 
    
   @Test
   void testFalseOnIllegalStateExeception() { 
      ensureImmediateReturnFor(new IllegalStateException());
   } 
 
   @SuppressWarnings("serial") 
   @Test
   void testFalseOnExecutionException() { 
      ensureImmediateReturnFor(new ExecutionException() {
      }); 
   }