commons-file/src/main/java/info/monitorenter/util/ExceptionUtil.java
public static InputStreamTracer findMatchInSystemErr(final String expectMatch) throws IOException {
    InputStream systemout = captureSystemErrForDebuggingPurposesOnly(true);
    InputStreamTracer result = new InputStreamTracer(systemout, expectMatch,
        Charset.defaultCharset());
    Thread traceThread = new Thread(result);
    traceThread.setDaemon(true);
    traceThread.start();
    return result;
  }
public static InputStreamTracer findMatchInSystemErr(final String expectMatch) throws IOException {
    InputStream systemout = captureSystemErrForDebuggingPurposesOnly(true);
    InputStreamTracer result = new InputStreamTracer(systemout, expectMatch,
        Charset.defaultCharset());
    Thread traceThread = new Thread(result);
    traceThread.setDaemon(true);
    traceThread.start();
    return result;
  }
Returns an instance to a runnable running in a separate Thread that tries to match the expected
output in {@link System#err}.
<p>
Ensure that you found the expected String in the input stream given by calling
{@link info.monitorenter.util.ExceptionUtil.InputStreamTracer#isMatched()}. But take into account that it is time -
critical (concurrency) if your result was found.
<p>
Prefer this instead of {@link #captureSystemErrForDebuggingPurposesOnly(boolean)} as this will
avoid blocking your application.
<p>

@return an instance to a runnable running in a separate Thread that tries to match the expected
output in {@link System#out}.
@throws java.io.IOException
if something goes wrong.