Buggy code:
class NotificationBuilder { enum DetectedTestRunBehaviour { PENDING , START_FIRES_FIRST , TEST_INSTANCE_CREATED_FIRST , ALL_TESTINSTANCES_ARE_CREATED_FIRST , TEST_INSTANCES_ARE_REUSED , INCONSISTENT_BEHAVIOUR ; } private static final Pattern methodDisplayNameRgx = Pattern . compile ( "^[^\\(\\[]++" ) ; private final Method [ ] testMethods ; private final List < ? > pendingTestInstances ; private final PowerMockTestNotifier powerMockTestNotifier ; private NotificationBuilder . DetectedTestRunBehaviour behaviour = NotificationBuilder . DetectedTestRunBehaviour . PENDING ; private Description currentDescription ; private Object currentTestInstance ; private String testClassName ; private Object latestTestInstance ; private Method latestMethod ; private static final Object [ ] unsupportedMethodArgs = new Object [ ] { } ; private final Map < Object , List < Method > > methodsPerInstance = new IdentityHashMap < Object , List < Method > > ( ) { @ Override public List < Method > get ( Object key ) { } } ; private final Map < Description , NotificationBuilder . OngoingTestRun > ongoingTestRuns = new IdentityHashMap < Description , NotificationBuilder . OngoingTestRun > ( ) ; private class OngoingTestRun implements TestMethodResult { final Description testDescription ; final Object testInstance ; final Method testMethod ; private Result result ; OngoingTestRun ( Description testDescription , Object testInstance ) { } Class < ? > testClass ( ) { } void report ( Result result ) { } public Result getResult ( ) { } } public NotificationBuilder ( Method [ ] testMethods , PowerMockTestNotifier notifier , List < ? > pendingTestInstances ) { } private Method determineTestMethod ( Description d ) { } private Class < ? > reloadParamType ( Class < ? > testClass , Class < ? > typeToReload ) { } private Method reloadMethod ( Class < ? > testClass , Method m ) { } void testSuiteStarted ( Class < ? > testClass ) { } void testStartHasBeenFired ( Description d ) { NotificationBuilder . OngoingTestRun oldTestRun = ongoingTestRuns . get ( d ) ; if ( ( null != oldTestRun ) && ( null != ( oldTestRun . getResult ( ) ) ) ) { throw new IllegalStateException ( ( "Fired<seq2seq4repair_space>testrun<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>running:<seq2seq4repair_space>" + d ) ) ; } currentDescription = d ; switch ( behaviour ) { case PENDING : behaviour = NotificationBuilder . DetectedTestRunBehaviour . START_FIRES_FIRST ; case START_FIRES_FIRST : return ; case TEST_INSTANCE_CREATED_FIRST : if ( ( currentTestInstance ) == ( latestTestInstance ) ) { behaviour = NotificationBuilder . DetectedTestRunBehaviour . TEST_INSTANCES_ARE_REUSED ; } case TEST_INSTANCES_ARE_REUSED : latestTestInstance = currentTestInstance ; methodsPerInstance . get ( currentTestInstance ) . add ( new NotificationBuilder . OngoingTestRun ( d , currentTestInstance ) . testMethod ) ; return ; case ALL_TESTINSTANCES_ARE_CREATED_FIRST : <START_BUG> System . err . println ( "Notifications<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>when<seq2seq4repair_space>all<seq2seq4repair_space>test-instances<seq2seq4repair_space>are<seq2seq4repair_space>reated<seq2seq4repair_space>first!" ) ; <END_BUG> return ; default : throw new AssertionError ( ) ; } } void testInstanceCreated ( Object newTestInstance ) { } void testIgnored ( Description d ) { } void assumptionFailed ( Description d ) { } void failure ( Failure f ) { } void testFinished ( Description d ) { } private boolean notify ( Description d , Result result ) { } }

Fix:
System . err . println ( "Notifications<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>when<seq2seq4repair_space>all<seq2seq4repair_space>test-instances<seq2seq4repair_space>are<seq2seq4repair_space>created<seq2seq4repair_space>first!" ) ;