title: JUnit timeout on @BeforeClass
body: <p>Tests in JUnit, annotated with @Test can have a timeout set in ms, for example:</p>
  
  <pre><code>@Test(timeout = 1000)
  public void testSomething(){
      ....
  }
  </code></pre>
  
  <p>However, I can't seem to find a way to put a timeout on the setup (or @BeforeClass). </p>
  
  <p>Is there any other sensible way to do this? I wonder if there is some reason @BeforeClass cannot have a timeout?</p>
  
  <p>I would like to do this:</p>
  
  <pre><code>@BeforeClass(timeout = 1000) // &lt;-- Not currently possible
  public static void setup(){
      doSomethingWhichMayRunForever();
  }
  </code></pre>
  
  <p>Edit: added 'static'</p>