Buggy code:
public static void forceGC ( final Reference < ? > ref , final long timeout ) { } public static void checkWeakReferences ( final WeakReference < ? > ... references ) { } public static String threadDump ( final String msg ) { } public void logAndSystemOut ( String message , Exception e ) { } public void logAndSystemOut ( String message ) { } protected static TestSuite createAIOTestSuite ( final Class < ? > clazz ) { } public static String dumpBytes ( final byte [ ] bytes ) { } public static String dumbBytesHex ( final byte [ ] buffer , final int bytesPerLine ) { } public static void assertEqualsByteArrays ( final byte [ ] expected , final byte [ ] actual ) { } public static void assertEqualsTransportConfigurations ( final TransportConfiguration [ ] expected , final TransportConfiguration [ ] actual ) { } public static void assertEqualsBuffers ( final int size , final HornetQBuffer expected , final HornetQBuffer actual ) { } public static void assertEqualsByteArrays ( final int length , final byte [ ] expected , final byte [ ] actual ) { } public static void assertSameXids ( final List < Xid > expected , final List < Xid > actual ) { } protected static void checkNoBinding ( final Context context , final String binding ) { } protected static Object checkBinding ( final Context context , final String binding ) throws Exception { } protected ArrayList < String > registerConnectors ( final HornetQServer server , final List < TransportConfiguration > connectorConfigs ) { } protected static final void checkFreePort ( final int ... ports ) { } protected final String getTestDir ( ) { } protected final void setTestDir ( String testDir ) { } protected final void clearData ( ) { } private final void deleteTmpDir ( ) { } protected void clearData ( final String testDir1 ) { } public String getJournalDir ( ) { } protected String getJournalDir ( final String testDir1 ) { } protected String getJournalDir ( final int index , final boolean backup ) { } protected String getBindingsDir ( ) { } protected static String getBindingsDir ( final String testDir1 ) { } protected String getBindingsDir ( final int index , final boolean backup ) { } protected String getPageDir ( ) { } protected static String getPageDir ( final String testDir1 ) { } protected String getPageDir ( final int index , final boolean backup ) { } protected String getLargeMessagesDir ( ) { } protected static String getLargeMessagesDir ( final String testDir1 ) { } protected String getLargeMessagesDir ( final int index , final boolean backup ) { } private static String directoryNameSuffix ( int index , boolean backup ) { } protected String getClientLargeMessagesDir ( ) { } protected String getClientLargeMessagesDir ( final String testDir1 ) { } protected final String getTemporaryDir ( ) { } protected String getTemporaryDir ( final String testDir1 ) { } protected static void expectHornetQException ( final String message , final HornetQExceptionType errorCode , final UnitTestCase . HornetQAction action ) { } protected static void expectHornetQException ( final HornetQExceptionType errorCode , final UnitTestCase . HornetQAction action ) { } protected static void expectXAException ( final int errorCode , final UnitTestCase . HornetQAction action ) { } public static byte getSamplebyte ( final long position ) { } public static InputStream createFakeLargeStream ( final long size ) throws Exception { } protected void validateGettersAndSetters ( final Object pojo , final String ... ignoredProperties ) throws Exception { } Map < Thread , StackTraceElement [ ] > previousThreads ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } private ArrayList < Exception > checkCsfStopped ( ) { } private void assertAllClientProducersAreClosed ( ) { } private void closeAllOtherComponents ( ) { } private boolean checkThread ( StringBuffer buffer ) { boolean failedThread = false ; Map < Thread , StackTraceElement [ ] > postThreads = Thread . getAllStackTraces ( ) ; <START_BUG> if ( ( postThreads != null ) && ( ( postThreads . size ( ) ) > ( previousThreads . size ( ) ) ) ) { <END_BUG> buffer . append ( "*********************************************************************************\n" ) ; buffer . append ( "LEAKING<seq2seq4repair_space>THREADS\n" ) ; for ( Thread aliveThread : postThreads . keySet ( ) ) { final String name = aliveThread . getName ( ) ; final boolean notSunPKCS11 = ! ( name . contains ( "SunPKCS11" ) ) ; final boolean notAttachListener = ! ( name . contains ( "Attach<seq2seq4repair_space>Listener" ) ) ; ThreadGroup group = aliveThread . getThreadGroup ( ) ; final boolean isSystemThread = ( group != null ) && ( "system" . equals ( group . getName ( ) ) ) ; final boolean notProcessReaper = isSystemThread && ( ! ( name . equals ( "process<seq2seq4repair_space>reaper" ) ) ) ; if ( ( ( notSunPKCS11 && notAttachListener ) && notProcessReaper ) && ( ! ( previousThreads . containsKey ( aliveThread ) ) ) ) { failedThread = true ; buffer . append ( "=============================================================================\n" ) ; buffer . append ( ( ( "Thread<seq2seq4repair_space>" + aliveThread ) + "<seq2seq4repair_space>is<seq2seq4repair_space>still<seq2seq4repair_space>alive<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>stackTrace:\n" ) ) ; StackTraceElement [ ] elements = postThreads . get ( aliveThread ) ; for ( StackTraceElement el : elements ) { buffer . append ( ( el + "\n" ) ) ; } } } buffer . append ( "*********************************************************************************\n" ) ; } return failedThread ; } private void checkFilesUsage ( ) { } private void cleanupPools ( ) { } protected static final byte [ ] autoEncode ( final Object ... args ) { } protected static final void recreateDirectory ( final String directory ) { } protected static final boolean deleteDirectory ( final File directory ) { } protected static final void copyRecursive ( final File from , final File to ) throws Exception { }

Fix:
if ( ( ( postThreads != null ) && ( ( previousThreads ) != null ) ) && ( ( postThreads . size ( ) ) > ( previousThreads . size ( ) ) ) ) {