title: Make JUnit test fail on System.exit somewhere in another thread
body: <p>I have a functional test of Multi-threading system. The problem is that the system uses System.exit so my junit test doesn't catch this errors. So I want my test fail if somewhere System.exit was called, even in another threads. </p>
  
  <p>I used <a href="https://stackoverflow.com/questions/309396/java-how-to-test-methods-that-call-system-exit">Java: How to test methods that call System.exit()?</a> to prevent JVM stop on System.exit and throw ExitException instead. Also I used <a href="http://blog.cedarsoft.com/2011/12/junit-rule-fail-tests-on-exceptionsfailed-assertions-in-other-threads/" rel="nofollow noreferrer">http://blog.cedarsoft.com/2011/12/junit-rule-fail-tests-on-exceptionsfailed-assertions-in-other-threads/</a> to collect this exceptions.
  I want my test to stop after ExitException with fail. But this exception stops only current thread. I tried to call junitThread.interrupt() before throwing ExitException but it is works perfectly only for simple tests. </p>
  
  <p>How can I break junit test on throwing ExitException in any thread if I can't modify thread creation code?</p>