spiceJ/proxy/src/main/java/at/borkowski/spicej/proxy/StreamGobbler.java
public void waitFor() throws Throwable {
      while (!finished) {
         try {
            synchronized (this) {
               this.wait(100);
            }
         } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
         }
      }

      if (t != null)
         throw t;
   }
public void waitFor() throws Throwable {
      while (!finished) {
         try {
            synchronized (this) {
               this.wait(100);
            }
         } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
         }
      }

      if (t != null)
         throw t;
   }
Waits until the gobbler finished. If the gobbler encountered any
exception, it is thrown from this method.

@throws Throwable
if the gobbler has thrown an exception