when( mockProcess.getOutputStream() ).thenReturn( mock( OutputStream.class ) );
when( mockProcess.waitFor() ).thenReturn( 1 );
when( mockProcess.exitValue() ).thenReturn( 1 ); // why was this here in the original test?
Commandline commandLineMock = mock( Commandline.class );
when( commandLineMock.execute() ).thenReturn( mockProcess );
Arg argMock = mock( Arg.class );
when( commandLineMock.createArg() ).thenReturn( argMock );
CommandLineFactory commandLineFactoryMock = mock( CommandLineFactory.class );