code: public int waitForExit(final Deadline deadline, final int expected)
  	{
  		final int code = waitForExit(deadline);
  
  		if (code == Integer.MIN_VALUE)
  			throw new RuntimeException("Unexpected timeout while waiting for exit and expecting code " + expected,
  			                           new TimeoutException("waitForExit timed out"));
  		else if (code != expected)
  			throw new RuntimeException("Unexpected code: wanted " + expected + " but got " + code);
  		else
  			return code;
  	}
docs: Wait until <code>deadline</code> for the process to exit, expecting the return code to be <code>expected</code>. If the
  output is not <code>expected</code> (or if the operation times out) then a RuntimeException is thrown<br />
  In the event of a timeout the process is not terminated
  
  @param deadline
  @param expected
  
  @return the exit code of the process
  
  @throws RuntimeException
  if a timeout occurrs or if the return code was not what was expected