### Question:
DefaultShellCommandHelper implements ShellCommandHelper { public boolean isRunning( long idCommand ) { boolean isIdRunning = running.contains( idCommand ); log.debug( "process running for id {}? {}", idCommand, isIdRunning ); return isIdRunning; }  Properties getSystemEnvVars(); ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments, File output,
                                                long idCommand, Map<String, String> environments ); ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments,
                                                File output, long idCommand, Map<String, String> environments ); ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments,
                                                OutputConsumer io, long idCommand,
                                                Map<String, String> environments ); void executeGoals( File workingDirectory, String executable, String goals, boolean interactive,
                              String arguments, ReleaseResult relResult, Map<String, String> environments ); void executeGoals( File workingDirectory, String executable, String goals, boolean interactive,
                              String[] arguments, ReleaseResult relResult, Map<String, String> environments ); boolean isRunning( long idCommand ); void killProcess( long idCommand );  }### Answer:
@Test public void testIsRunning() throws Exception { long virtualPid = 1, sleepMillis = 100; RunChecker checker = new RunChecker( helper, virtualPid, sleepMillis ); String[] cmdArgs = { "-cp", sleepClasspath, Sleep.class.getCanonicalName(), "1" }; checker.run(); assertFalse( "Expected that command was not running", checker.wasRunning ); Thread checkerThread = new Thread( checker ); checkerThread.start(); helper.executeShellCommand( null, javaPath, cmdArgs, new LogOutputConsumer( log ), virtualPid, null ); checkerThread.join(); assertTrue( "Expected that command was running", checker.wasRunning ); checker.run(); assertFalse( "Expected that command was not running", checker.wasRunning ); }