title: @parameters method is executed before @beforeclass method
body: <p>I'm using "parametrized" feature of junit 4 and I noticed that @parameters method is executed before @beforeclass method. This is creating a problem for me because the parameters i'm passing to the test cases via @parameters depends on the code initialize in the @beforeclass method. For example</p>
  
  <pre><code>@RunWith(Parameterized.class)
  public class TestOtherClass {
  
      String argument;
      private static boolean initializeThis;
  
      public TestOtherClass(String parameter) throws Exception {
          argument=parameter;
      }
  
      @BeforeClass
      public static void doSetup() {
          System.out.println("Doing setup before class...");
          initializeThis=true; // true or false, based on some condition
      }
  
      @Test
      public void otherTest() {
          System.out.println("Other test: " + argument);
      }
  
      @Parameters
      public static Collection&lt;Object[]&gt; getData(){
          System.out.println("Inside parameter");
          String addThis;
          if(initializeThis)
              addThis="adding true";
          else
              addThis="adding false";
  
          Object[] para1 = new Object[]{"First parameter :: " + addThis};
          Object[] para2 = new Object[]{"Second parameter :: " + addThis};
  
          Collection&lt;Object[]&gt; classNames = new ArrayList&lt;Object[]&gt;();
          classNames.add(para1);
          classNames.add(para2);
          return classNames;
      }
  }
  </code></pre>
  
  <p>Now, I'm initializing variable "initializeThis" to true in @beforeclass method but (surprisingly) when I executed the test case it prints </p>
  
  <pre><code>Other test: First parameter :: adding false
  Other test: Second parameter :: adding false
  </code></pre>
  
  <p>That is something not expected.<br>
  My question is; is there any way to execute the @beforeclass method before @parameters, can we do this is in junit 4?</p>