// find TestsProvider that can instantiate testName
final String providerPid = tests.get(testName);
if(providerPid == null) {
throw new IllegalStateException("Provider PID not found for test " + testName);
}
TestsProvider provider = null;
for(TestsProvider p : providers) {
if(p.getServicePid().equals(providerPid)) {
provider = p;
break;
}
}
if(provider == null) {
throw new IllegalStateException("No TestsProvider found for PID " + providerPid);
}
log.debug("Using provider {} to create test class {}", provider, testName);
return provider.createTestClass(testName);
}