Buggy code:
@ RunWith ( PowerMockRunner . class ) @ PrepareForTest ( Job . class ) public class WebAdminRendererTest { @ Mock Scheduler sobjSched ; @ Mock LogManager sobjLogManager ; @ Mock Job job1 ; @ Mock Job job2 ; String newline = "\n" ; @ BeforeClass public static void setUp ( ) { } @ Test public void testRenderJobFailStatsEmpty ( ) { } @ Test public void testRenderJobFailStatsMultiple ( ) { } @ Test public void testRenderLogsMultiple ( ) { } @ Test public void testRenderLogsNone ( ) { } @ Test public void testGetUptime ( ) { } @ Test public void testRenderJobWaitStatsEmpty ( ) { } @ Test public void testRenderJobWaitStatsMultiple ( ) { } @ Test public void testRenderJobRunStatsEmpty ( ) { } @ Test public void testRenderJobRunStatsMultiple ( ) { } @ Test public void testRenderFailedJobsNone ( ) { } @ Test public void testRenderFailedJobsMultiple ( ) { <START_BUG> String jobsTruth = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<table<seq2seq4repair_space>width=\"100%\"<seq2seq4repair_space>cellpadding=\"0\"<seq2seq4repair_space>cellspacing=\"0\">" + ( newline ) ) + "<seq2seq4repair_space><thead>" ) + ( newline ) ) + "<seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Job<seq2seq4repair_space>Type<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>type<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>text<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>backtrace<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr>" ) + ( newline ) ) + "<seq2seq4repair_space><//thead>" ) + ( newline ) ) + "<seq2seq4repair_space><tbody>" ) + ( newline ) ) + "<seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>job<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<//b><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<b><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<//b><seq2seq4repair_space><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr><seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>job<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>java.lang.<seq2seq4repair_space>IllegalArgumentException<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>text<seq2seq4repair_space>2<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>eu.sqooss.test.service.webadmin.WebAdminRendererTest.<seq2seq4repair_space>testRenderFailedJobsMultiple(),<seq2seq4repair_space>(WebAdminRendererTest.java:286)<br//>sun.reflect.NativeMethodAccessorImpl.<seq2seq4repair_space>invoke0(),<seq2seq4repair_space>(null:-2)<br//>sun.reflect.NativeMethodAccessorImpl.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(null:-1)<br//>sun.reflect.DelegatingMethodAccessorImpl.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(null:-1)<br//>java.lang.reflect.Method.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(null:-1)<br//>org.junit.internal.runners.TestMethod.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(TestMethod.java:66)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>runTestMethod(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:310)<br//>org.junit.internal.runners.MethodRoadie$2.<seq2seq4repair_space>run(),<seq2seq4repair_space>(MethodRoadie.java:86)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>runBeforesThenTestThenAfters(),<seq2seq4repair_space>(MethodRoadie.java:94)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>executeTest(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:294)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>runBeforesThenTestThenAfters(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:282)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>runTest(),<seq2seq4repair_space>(MethodRoadie.java:84)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>run(),<seq2seq4repair_space>(MethodRoadie.java:49)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>invokeTestMethod(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:207)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>runMethods(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:146)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:120)<br//>org.junit.internal.runners.ClassRoadie.<seq2seq4repair_space>runUnprotected(),<seq2seq4repair_space>(ClassRoadie.java:34)<br//>org.junit.internal.runners.ClassRoadie.<seq2seq4repair_space>runProtected(),<seq2seq4repair_space>(ClassRoadie.java:44)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:118)<br//>org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<seq2seq4repair_space>run(),<seq2seq4repair_space>(JUnit4TestSuiteChunkerImpl.java:101)<br//>org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(AbstractCommonPowerMockRunner.java:53)<br//>org.powermock.modules.junit4.PowerMockRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockRunner.java:53)<br//>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<seq2seq4repair_space>run(),<seq2seq4repair_space>(JUnit4TestReference.java:50)<br//>org.eclipse.jdt.internal.junit.runner.TestExecution.<seq2seq4repair_space>run(),<seq2seq4repair_space>(TestExecution.java:38)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>runTests(),<seq2seq4repair_space>(RemoteTestRunner.java:459)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>runTests(),<seq2seq4repair_space>(RemoteTestRunner.java:675)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(RemoteTestRunner.java:382)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>main(),<seq2seq4repair_space>(RemoteTestRunner.java:192)<br//><seq2seq4repair_space><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr><seq2seq4repair_space><//tbody>" ) + ( newline ) ) + "<//table>" ; <END_BUG> Whitebox . setInternalState ( WebAdminRenderer . class , sobjSched ) ; when ( sobjSched . getFailedQueue ( ) ) . thenReturn ( new Job [ ] { job1 , job2 , null } ) ; when ( job2 . getErrorException ( ) ) . thenReturn ( new IllegalArgumentException ( "Exception<seq2seq4repair_space>text<seq2seq4repair_space>2" ) ) ; String jobsOut = WebAdminRenderer . renderFailedJobs ( ) ; assertEquals ( jobsTruth , jobsOut ) ; } No newline ; at end ; of file ; }

Fix:
String jobsTruth = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<table<seq2seq4repair_space>width=\"100%\"<seq2seq4repair_space>cellpadding=\"0\"<seq2seq4repair_space>cellspacing=\"0\">" + ( newline ) ) + "<seq2seq4repair_space><thead>" ) + ( newline ) ) + "<seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Job<seq2seq4repair_space>Type<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>type<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>text<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>backtrace<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr>" ) + ( newline ) ) + "<seq2seq4repair_space><//thead>" ) + ( newline ) ) + "<seq2seq4repair_space><tbody>" ) + ( newline ) ) + "<seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>job<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<//b><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<b><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td><b>NA<//b><seq2seq4repair_space><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr><seq2seq4repair_space><tr>" ) + ( newline ) ) + "<seq2seq4repair_space><td>job<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>java.lang.<seq2seq4repair_space>IllegalArgumentException<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>Exception<seq2seq4repair_space>text<seq2seq4repair_space>2<//td>" ) + ( newline ) ) + "<seq2seq4repair_space><td>eu.sqooss.test.service.webadmin.WebAdminRendererTest.<seq2seq4repair_space>testRenderFailedJobsMultiple(),<seq2seq4repair_space>(WebAdminRendererTest.java:284)<br//>sun.reflect.NativeMethodAccessorImpl.<seq2seq4repair_space>invoke0(),<seq2seq4repair_space>(NativeMethodAccessorImpl.java:-2)<br//>sun.reflect.NativeMethodAccessorImpl.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(NativeMethodAccessorImpl.java:57)<br//>sun.reflect.DelegatingMethodAccessorImpl.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(DelegatingMethodAccessorImpl.java:43)<br//>java.lang.reflect.Method.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(Method.java:606)<br//>org.junit.internal.runners.TestMethod.<seq2seq4repair_space>invoke(),<seq2seq4repair_space>(TestMethod.java:66)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>runTestMethod(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:310)<br//>org.junit.internal.runners.MethodRoadie$2.<seq2seq4repair_space>run(),<seq2seq4repair_space>(MethodRoadie.java:86)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>runBeforesThenTestThenAfters(),<seq2seq4repair_space>(MethodRoadie.java:94)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>executeTest(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:294)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.<seq2seq4repair_space>runBeforesThenTestThenAfters(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:282)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>runTest(),<seq2seq4repair_space>(MethodRoadie.java:84)<br//>org.junit.internal.runners.MethodRoadie.<seq2seq4repair_space>run(),<seq2seq4repair_space>(MethodRoadie.java:49)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>invokeTestMethod(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:207)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>runMethods(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:146)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:120)<br//>org.junit.internal.runners.ClassRoadie.<seq2seq4repair_space>runUnprotected(),<seq2seq4repair_space>(ClassRoadie.java:34)<br//>org.junit.internal.runners.ClassRoadie.<seq2seq4repair_space>runProtected(),<seq2seq4repair_space>(ClassRoadie.java:44)<br//>org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockJUnit44RunnerDelegateImpl.java:118)<br//>org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<seq2seq4repair_space>run(),<seq2seq4repair_space>(JUnit4TestSuiteChunkerImpl.java:101)<br//>org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(AbstractCommonPowerMockRunner.java:53)<br//>org.powermock.modules.junit4.PowerMockRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(PowerMockRunner.java:53)<br//>org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<seq2seq4repair_space>run(),<seq2seq4repair_space>(JUnit4TestReference.java:50)<br//>org.eclipse.jdt.internal.junit.runner.TestExecution.<seq2seq4repair_space>run(),<seq2seq4repair_space>(TestExecution.java:38)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>runTests(),<seq2seq4repair_space>(RemoteTestRunner.java:459)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>runTests(),<seq2seq4repair_space>(RemoteTestRunner.java:675)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>run(),<seq2seq4repair_space>(RemoteTestRunner.java:382)<br//>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.<seq2seq4repair_space>main(),<seq2seq4repair_space>(RemoteTestRunner.java:192)<br//><seq2seq4repair_space><//td>" ) + ( newline ) ) + "<seq2seq4repair_space><//tr><seq2seq4repair_space><//tbody>" ) + ( newline ) ) + "<//table>" ;