title: How to get rid of "Method parameters should be @State classes" in JMH when parameters come from another method?
body: <p>I'm working on a maven project. The scenario is something like below...</p>
  
  <pre><code>class Test {
  
      public void applyAll() {
          ....................
          ....................
          Collection&lt;Migratable&gt; applicableUpdates = SomeOtherClass.getApplicableUpdates();
          doUpdate(applicableUpdates);
  
      }
  
      @Benchmark
      public void apply(Migratable m) {
          ....................
          ....................
      }
  
      private void doUpdate(Collection&lt;Migratable&gt; applicableUpdates) throws Exception {
          for (Migratable m : applicableUpdates) {
              try {
  
                  apply(m);
  
              } catch (Exception e) {
                  logger.error("Falid to apply migration {}" + m, e);
                  throw e;
              }
          }
      }
  }
  </code></pre>
  
  <p>I need to compute how long it takes to execute each migration. Simply I need to compute the execution time of <b>apply(Migratable m)</b> method. <br>
  Now, when I build my project using "mvn clean install", build failed and it shows "Method parameters should be @State classes". <br> <br>
  Here, parameter comes from another method <b>doUpdate(Collection applicableUpdates)</b> [see the scenario]. So how can I get rid of this error in given scenario?</p>