public List<RemoteRunSpecification> forBrowserSpecifications(List<BrowserSpecification> browserSpecs, List<RemoteConfiguration> allRemoteMachineConfigurations) throws InvalidBrowserSpecificationException {
RemoteRunSpecificationMerger merger = new RemoteRunSpecificationMerger();
for (BrowserSpecification specification : browserSpecs) {
RemoteConfiguration remoteConfiguration = findRemoteConfigurationFor_in(specification, allRemoteMachineConfigurations);
if (remoteConfiguration == null)
throw new InvalidBrowserSpecificationException(specification.getBrowserType(), specification.getBrowserType());
Browser browser = remoteConfiguration.getBrowserMatching(specification);
if (browser == null)
throw new InvalidBrowserSpecificationException(specification.getBrowserType(), specification.getBrowserType());
merger.add(remoteConfiguration.getRemoteURL(), browser);
}
return merger.getResult();
}