Buggy code:
public abstract class TestProcessUtils { private static final int DEFAULT_PORT = 12934 ; private static final int PORT ; private static final int TIMEOUT_MILLISECONDS = 1000 ; static final Map < String , TestProcessUtils . TestCommand > COMMANDS ; public static List < String > createCommand ( String processName , String classname , int pmPort ) throws UnknownHostException { } public static List < String > createCommand ( String processName , String classname , int pmPort , int debugPort , boolean suspend ) throws UnknownHostException { List < String > cmd = new ArrayList < String > ( ) ; cmd . add ( TestProcessUtils . getJava ( ) ) ; cmd . add ( "-cp" ) ; cmd . add ( System . getProperty ( "java.class.path" ) ) ; if ( debugPort > 0 ) <START_BUG> cmd . add ( ( ( ( "-Xrunjdwp:transport=dt_socket,address=" + debugPort ) + ",server=y,suspend=" ) + ( suspend ? "y" : "n" ) ) ) ; <END_BUG> cmd . add ( classname ) ; cmd . add ( processName ) ; cmd . add ( PROCESS_CONTROLLER_BIND_PORT ) ; cmd . add ( String . valueOf ( pmPort ) ) ; cmd . add ( PROCESS_CONTROLLER_BIND_ADDR ) ; cmd . add ( InetAddress . getLocalHost ( ) . getHostAddress ( ) ) ; return cmd ; } public static TestProcessUtils . TestStreamManager createStreamManager ( TestProcessUtils . TestProcessController controller ) { } public static TestProcessUtils . TestProcessSenderStream createProcessClient ( String processName ) { } private static class ServerSocketThread extends Thread implements TestProcessUtils . TestStreamManager { TestProcessUtils . TestProcessController controller ; ServerSocket server ; Set < TestProcessUtils . ListenerSocketThread > listenerThreads = new HashSet < TestProcessUtils . ListenerSocketThread > ( ) ; CountDownLatch latch = new CountDownLatch ( 1 ) ; Map < String , TestProcessUtils . ListenerSocketThread > listenerThreadsByProcessName = new HashMap < String , TestProcessUtils . ListenerSocketThread > ( ) ; Map < String , CountDownLatch > startProcessLatches = new HashMap < String , CountDownLatch > ( ) ; Map < String , CountDownLatch > stopProcessLatches = new HashMap < String , CountDownLatch > ( ) ; ServerSocketThread ( TestProcessUtils . TestProcessController controller ) { } @ Override public void shutdown ( ) { } @ Override public TestProcessUtils . TestProcessListenerStream getProcessListener ( String name , long timeoutMillis ) { } @ Override public TestProcessUtils . TestProcessListenerStream createProcessListener ( String name ) { } @ Override public TestProcessUtils . TestProcessListenerStream createProcessListener ( String name , Runnable preWait ) { } public void detachProcessListener ( String name ) { } void processStarted ( String name , TestProcessUtils . ListenerSocketThread thread ) { } @ Override public void stopProcessListener ( String name ) { } void processStopped ( String name , TestProcessUtils . ListenerSocketThread thread ) { } void countdownLatch ( Map < String , CountDownLatch > latches , String processName ) { } void waitForStart ( ) { } @ Override public void run ( ) { } private synchronized void closeServer ( ) { } void removeThread ( TestProcessUtils . ListenerSocketThread listener ) { } } private static class ListenerSocketThread extends Thread implements TestProcessUtils . TestProcessListenerStream { volatile String processName ; final TestProcessUtils . ServerSocketThread serverSocketThread ; final Socket socket ; final BlockingQueue < String > messages = new LinkedBlockingQueue < String > ( ) ; public ListenerSocketThread ( TestProcessUtils . ServerSocketThread serverSocketThread , Socket socket ) { } public void exitProcess ( int exitCode ) throws IOException { } public void shutdown ( ) { } @ Override public String getProcessName ( ) { } @ Override public void run ( ) { } void processStarted ( String processName ) { } void processStopped ( String processName ) { } @ Override public String readMessage ( ) { } @ Override public String readMessage ( long timeoutMs ) { } void messageReceived ( String msg ) { } } public static class ClientSocketWriter implements TestProcessUtils . TestProcessSenderStream { final String processName ; final Socket socket ; final InputStream socketInput ; final PrintWriter socketOutput ; public ClientSocketWriter ( String processName ) { } public synchronized void shutdown ( ) { } public void writeData ( String msg ) { } @ Override public InputStream getInput ( ) { } } static void closeSocket ( Socket socket ) { } private static String getJava ( ) { } private abstract static class TestCommand { String processName ; TestCommand ( ) { } TestCommand ( String processName ) { } static void receive ( TestProcessUtils . ListenerSocketThread listener , String cmdString ) throws IOException { } abstract String cmd ( ) { } abstract void receive ( TestProcessUtils . ListenerSocketThread listener , String [ ] cmdData ) throws IOException { } public String formatCommandForSend ( ) { } @ Override public String toString ( ) { } } private static class StartCommand extends TestProcessUtils . TestCommand { StartCommand ( ) { } StartCommand ( String processName ) { } @ Override String cmd ( ) { } @ Override void receive ( TestProcessUtils . ListenerSocketThread listener , String [ ] cmdData ) { } } private static class StopCommand extends TestProcessUtils . TestCommand { StopCommand ( ) { } StopCommand ( String processName ) { } @ Override String cmd ( ) { } @ Override void receive ( TestProcessUtils . ListenerSocketThread listener , String [ ] cmdData ) { } } private static class MessageCommand extends TestProcessUtils . TestCommand { String command ; MessageCommand ( ) { } public MessageCommand ( String processName , String command ) { } @ Override String cmd ( ) { } @ Override void receive ( TestProcessUtils . ListenerSocketThread listener , String [ ] cmdData ) { } @ Override public String formatCommandForSend ( ) { } @ Override public String toString ( ) { } } public interface TestStreamManager { void shutdown ( ) { } TestProcessUtils . TestProcessListenerStream createProcessListener ( String name , Runnable preWait ) { } TestProcessUtils . TestProcessListenerStream createProcessListener ( String name ) { }

Fix:
cmd . add ( ( ( ( "-agentlib:jdwp=transport=dt_socket,address=" + debugPort ) + ",server=y,suspend=" ) + ( suspend ? "y" : "n" ) ) ) ;