private static RemoteWebDriver buildRemoteWebDriver(String hubUrl) {
		DesiredCapabilities capabilities = new DesiredCapabilities();
		capabilities.setPlatform(Platform.ANY);
		URL url;
		try {
			url = new URL(hubUrl);
		} catch (MalformedURLException e) {
			LOGGER.error("The given hub url of the remote server is malformed can not continue!",
					e);
			return null;
		}
		HttpCommandExecutor executor = null;
		try {
			executor = new HttpCommandExecutor(url);
		} catch (Exception e) {
			// TODO Stefan; refactor this catch, this will definitely result in
			// NullPointers, why
			// not throw RuntimeException direct?
			LOGGER.error(
					"Received unknown exception while creating the "
							+ "HttpCommandExecutor, can not continue!",
					e);
			return null;
		}
		return new RemoteWebDriver(executor, capabilities);
	}
private static RemoteWebDriver buildRemoteWebDriver ( String hubUrl ) { DesiredCapabilities capabilities = new DesiredCapabilities ( ) ; capabilities . setPlatform ( Platform . ANY ) ; URL url ; try { url = new URL ( hubUrl ) ; } catch ( MalformedURLException e ) { LOGGER . error ( "The given hub url of the remote server is malformed can not continue!" , e ) ; return null ; } HttpCommandExecutor executor = null ; try { executor = new HttpCommandExecutor ( url ) ; } catch ( Exception e ) { LOGGER . error ( "Received unknown exception while creating the " + "HttpCommandExecutor, can not continue!" , e ) ; return null ; } return new RemoteWebDriver ( executor , capabilities ) ; }
Private used static method for creation of a RemoteWebDriver. Taking care of the default
Capabilities and using the HttpCommandExecutor.

@param hubUrl the url of the hub to use.
@return the RemoteWebDriver instance.