public static <ExtraData>Test parameterizedTestSuite(Class<? extends JSR166TestCase> testClass,Class<ExtraData> dataClass,ExtraData data){
  try {
    TestSuite suite=new TestSuite();
    Constructor<?> c=testClass.getDeclaredConstructor(dataClass,String.class);
    for (    String methodName : testMethodNames(testClass))     suite.addTest((Test)c.newInstance(data,methodName));
    return suite;
  }
 catch (  Exception e) {
    throw new Error(e);
  }
}

public static < ExtraData > Test parameterizedTestSuite ( Class < ? extends JSR166TestCase > testClass , Class < ExtraData > dataClass , ExtraData data ) { try { TestSuite suite = new TestSuite ( ) ; Constructor < ? > c = testClass . getDeclaredConstructor ( dataClass , String . class ) ; for ( String methodName : testMethodNames ( testClass ) ) suite . addTest ( ( Test ) c . newInstance ( data , methodName ) ) ; return suite ; } catch ( Exception e ) { throw new Error ( e ) ; } }
returns junit - style testsuite for the given test class , but parameterized by passing extra data to each test .
