Buggy code:
public class FileUtilTest extends TestCase { public static final String [ ] NONE = new String [ 0 ] ; public static boolean log = false ; public static void main ( String [ ] args ) { } public static void assertSame ( String prefix , String [ ] lhs , String [ ] rhs ) { } public static String [ ] dirContains ( File dir , final String [ ] filenames ) { } public static String [ ] dirPaths ( File dir ) { } public static String [ ] dirPaths ( File dir , String [ ] suffixes ) { } private static void doDirPaths ( File dir , ArrayList paths ) { } private static void log ( String s ) { } final ArrayList tempFiles ; public FileUtilTest ( String s ) { } public void tearDown ( ) { } public void testNotIsFileIsDirectory ( ) { } public void testCopyFiles ( ) { } void checkCopyFiles ( File from , File to , Class exceptionClass , boolean clean ) { } public void testDirCopySubdirs ( ) throws IOException { } public void testDirCopySubdirsSuffix ( ) throws IOException { } public void testGetURL ( ) { } private void checkGetURL ( String arg ) { } public void testGetTempDir ( ) { } File checkGetTempDir ( String parent , String child , boolean ok , boolean delete ) { } public void testRandomFileString ( ) { } public void testNormalizedPath ( ) { } public void testFileToClassName ( ) { } public void testDeleteContents ( ) { } public void testLineSeek ( ) { } public void testLineSeekMore ( ) { } public void testDirCopyNoSubdirs ( ) throws IOException { } public void testDirCopyNoSubdirsWithSuffixes ( ) throws IOException { } public void testDirCopySubdirsSuffixRoundTrip ( ) throws IOException { } File makeTempDir ( String loc , String [ ] filenames ) throws IOException { } public void testPipeEmpty ( ) { } public void testPipeMin ( ) { } public void testPipe ( ) { } void checkPipe ( String data ) { } public void testPipeThrown ( ) { } public void testPipeHalt ( ) { final long MAX = 1000000 ; InputStream in = new InputStream ( ) { long max = 0 ; public int read ( ) throws IOException { if ( ( ( max ) ++ ) > MAX ) { throw new IOException ( "test<seq2seq4repair_space>failed" ) ; } return 1 ; } } ; final int minWritten = 20 ; class Flag { boolean hit ; } final Flag flag = new Flag ( ) ; OutputStream out = new OutputStream ( ) { long max = 0 ; public void write ( int b ) throws IOException { if ( ( ( max ) ++ ) > MAX ) { throw new IOException ( "test<seq2seq4repair_space>failed" ) ; } else if ( ( max ) > minWritten ) { if ( ! ( flag . hit ) ) { flag . hit = true ; } } } } ; class Result { long totalWritten ; Throwable thrown ; boolean set ; } final Result result = new Result ( ) ; FileUtil . Pipe pipe = new FileUtil . Pipe ( in , out ) { protected void completing ( long totalWritten , Throwable thrown ) { result . totalWritten = totalWritten ; result . thrown = thrown ; result . set = true ; } } ; new Thread ( pipe ) . start ( ) ; while ( ! ( flag . hit ) ) { try { Thread . sleep ( 5L ) ; } catch ( InterruptedException e ) { } } assertTrue ( pipe . halt ( true , true ) ) ; assertTrue ( result . set ) ; <START_BUG> assertTrue ( ( null == ( result . thrown ) ) ) ; <END_BUG> assertTrue ( ( null == ( pipe . getThrown ( ) ) ) ) ; assertEquals ( "total<seq2seq4repair_space>written" , result . totalWritten , pipe . totalWritten ( ) ) ; if ( minWritten > ( pipe . totalWritten ( ) ) ) { assertTrue ( ( "written:<seq2seq4repair_space>" + ( pipe . totalWritten ( ) ) ) , false ) ; } } }

Fix:
assertTrue ( ( "Expected<seq2seq4repair_space>null<seq2seq4repair_space>but<seq2seq4repair_space>result.thrown<seq2seq4repair_space>=<seq2seq4repair_space>" + ( result . thrown ) ) , ( null == ( result . thrown ) ) ) ;