question: @ AfterMethod public void tearDown ( ) throws Exception { Throwable t = threadFailure . getAndSet ( null ) ; if ( t != null ) { if ( t instanceof Error ) throw ( Error ) t ; else if ( t instanceof RuntimeException ) throw ( RuntimeException ) t ; else if ( t instanceof Exception ) throw ( Exception ) t ; else { AssertionFailedError afe = new AssertionFailedError ( t . toString ( ) ) ; afe . initCause ( t ) ; throw afe ; } } if ( Thread . interrupted ( ) ) tearDownFail ( "interrupt status set in main thread" ) ; checkForkJoinPoolThreadLeaks ( ) ; }
target:  Extra checks that get done for all test cases. Triggers test case failure if any thread assertions have failed, by rethrowing, in the test harness thread, any exception recorded earlier by threadRecordFailure. Triggers test case failure if interrupt status is set in the main thread.