Source:
public BaseRemoteProxy(RegistrationRequest request, Registry registry) { this.request = request; this.registry = registry; this.config = mergeConfig(registry.getConfiguration().getAllParams(), request.getConfiguration()); String url = (String) config.get(REMOTE_HOST); String id = (String) config.get(RegistrationRequest.ID); if (url == null && id == null) { throw new GridException( "The registration request needs to specify either the remote host, or a valid id."); } if (url != null) { try { this.remoteHost = new URL(url); } catch (MalformedURLException e) { throw new GridException("Not a correct url to register a remote : " + url); } } if (id != null) { this.id = id; } else { this.id = id = "http://" + remoteHost.getHost() + ":" + remoteHost.getPort(); } maxConcurrentSession = getConfigInteger(RegistrationRequest.MAX_SESSION); cleanUpCycle = getConfigInteger(RegistrationRequest.CLEAN_UP_CYCLE); timeOutMs = getConfigInteger(RegistrationRequest.TIME_OUT); statusCheckTimeout = getConfigInteger(RegistrationRequest.STATUS_CHECK_TIMEOUT); List<DesiredCapabilities> capabilities = request.getCapabilities(); List<TestSlot> slots = new ArrayList<>(); for (DesiredCapabilities capability : capabilities) { Object maxInstance = capability.getCapability(MAX_INSTANCES); SeleniumProtocol protocol = getProtocol(capability); String path = getPath(capability); if (maxInstance == null) { log.warning("Max instance not specified. Using default = 1 instance"); maxInstance = "1"; } int value = Integer.parseInt(maxInstance.toString()); for (int i = 0; i < value; i++) { Map<String, Object> c = new HashMap<>(); for (String k : capability.asMap().keySet()) { c.put(k, capability.getCapability(k)); } slots.add(new TestSlot(this, protocol, path, c)); } } this.testSlots = Collections.unmodifiableList(slots); }

Target:
public BaseRemoteProxy(RegistrationRequest request, Registry registry) { this.request = request; this.registry = registry; this.config = mergeConfig(registry.getConfiguration().getAllParams(), request.getConfiguration()); String url = (String) config.get(REMOTE_HOST); String id = (String) config.get(RegistrationRequest.ID); if (url == null && id == null) { throw new GridException( "The registration request needs to specify either the remote host, or a valid id."); } if (url != null) { try { this.remoteHost = new URL(url); } catch (MalformedURLException e) { throw new GridException("Not a correct url to register a remote : " + url); } } if (id != null) { this.id = id; } else { this.id = "http://" + remoteHost.getHost() + ":" + remoteHost.getPort(); } maxConcurrentSession = getConfigInteger(RegistrationRequest.MAX_SESSION); cleanUpCycle = getConfigInteger(RegistrationRequest.CLEAN_UP_CYCLE); timeOutMs = getConfigInteger(RegistrationRequest.TIME_OUT); statusCheckTimeout = getConfigInteger(RegistrationRequest.STATUS_CHECK_TIMEOUT); List<DesiredCapabilities> capabilities = request.getCapabilities(); List<TestSlot> slots = new ArrayList<>(); for (DesiredCapabilities capability : capabilities) { Object maxInstance = capability.getCapability(MAX_INSTANCES); SeleniumProtocol protocol = getProtocol(capability); String path = getPath(capability); if (maxInstance == null) { log.warning("Max instance not specified. Using default = 1 instance"); maxInstance = "1"; } int value = Integer.parseInt(maxInstance.toString()); for (int i = 0; i < value; i++) { Map<String, Object> c = new HashMap<>(); for (String k : capability.asMap().keySet()) { c.put(k, capability.getCapability(k)); } slots.add(new TestSlot(this, protocol, path, c)); } } this.testSlots = Collections.unmodifiableList(slots); }