private static Object createTestObject(TestClass testClass) throws InitializationError { try { return testClass.getOnlyConstructor().newInstance(); } catch (Exception ex) { throw new InitializationError(ex); } }
public Suite2(Class<?> testClass) throws InitializationError { fTestClass = new TestClass(testClass); try { fInstance = fTestClass.getOnlyConstructor().newInstance(); } catch (Exception e) { throw new InitializationError(e); } }