title: Junit: How to make every @Test methods isolated completely?
body: <p>Example code:</p>
  
  <pre><code>public class Count {
      static int count;
  
      public static int add() {
         return ++count;
      } 
  }
  </code></pre>
  
  <p>I want test1 and test2 run totally separately so that they both pass. How can I finish that? My IDE is Intellij IDEA.</p>
  
  <hr>
  
  <pre><code>public class CountTest {
      @Test
      public void test1() throws Exception {
          Count.add();
          assertEquals(1, Count.count);//pass.Now count=1
      }
  
      @Test
      public void test2() throws Exception {
          Count.add();
          assertEquals(1, Count.count);//error, now the count=2
      }
  }
  </code></pre>
  
  <p>Assume the test1 runs before test2.</p>
  
  <p>This is just a simplified code. In fact the code is more complex so I can't just make <code>count=0</code> in <code>@after</code> method.</p>