title: Is there a way to invoke a collection of methods at once using reflection Java?
body: <p>Basically I am running selenium tests with the use of a DataProvider and a single base method that is the starting point to invoke all of my tests. The test methods are in a different class and I want to be able to invoke all of the methods at once since I am running the tests in parallel instead of one at a time (serially).  Is there a way to do that? Below is the main code:</p>
  
  <pre><code> @Test(enabled = true, dataProvider = DataProviderUtils.REGRESSION, dataProviderClass = DataProviderUtils.class)
  public void test(String env, String browser, String title, String id, String orderType, String productType, String isFreeShipping, String isTaxState,
                        String billingCountry, String shippingCountry, String promoType, String isPromoFree,
                        String isPromoCode, String noOfPromoCodes, String email, Object[] customSteps){
  
      driverUtils.setUp(browser);
  
      Class[] classes = {UseCases.class};
      for(Class clazz : classes){
          Method[] methods = clazz.getDeclaredMethods();
          for(Method method : methods){
              try {
                  method = clazz.getMethod(method.getName(), new Class[]{String.class, String.class, String.class, String.class, String.class, String.class, Object[].class});
                  Object invoke = method.invoke(new UseCases(), id, env, productType, isFreeShipping, isTaxState, billingCountry, customSteps);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>Thank you</p>