title: how to understand @Test & @BeforeClass?
body: <p>I am beginning with JUnit and do not understand the annotations <code>@Test</code> and <code>@BeforeClass</code>.<br>
  I have the following code:</p>
  
  <pre><code>public class Toto { 
  @BeforeClass
      public static void setupOnce() {
          final Thread thread = new Thread() {
              public void run() {
                  Main.main(new String[]{"-arg1", "arg2"});
              }
          };
          try {
              thread.start();
          } catch (Exception ex) {
          }
      }
  </code></pre>
  
  <p>Why <code>@BeforeClass</code>? And what's the <code>setupOnce()</code> and threads in this case?<br>
  Should we add <code>@Test</code> before each Java test?<br>
  So if I have 30 Java tests, should I have <code>@Test public void test()</code> in each Java file?</p>