I move this part into a method to be able to self shunt. I need that because the HttpCommandExector does a CURL call against the selenium server. That would mean, that a unit test is actually using a running selenium server. Unit Tests should never run again any kind of infrastructure or service. You should be able to mock everything and just test the unit.

Another approach would be, to pass the CommandExecutor to the create method, but that would mean a hard bc break and refactoring. That way i could pass a mock into the create method and test it.