...23import org.openqa.selenium.grid.log.LoggingOptions;24import org.openqa.selenium.grid.node.Node;25import org.openqa.selenium.grid.node.SessionFactory;26import org.openqa.selenium.grid.node.config.DriverServiceSessionFactory;27import org.openqa.selenium.grid.node.config.NodeOptions;28import org.openqa.selenium.grid.server.BaseServerOptions;29import org.openqa.selenium.grid.server.EventBusOptions;30import org.openqa.selenium.grid.server.NetworkOptions;31import org.openqa.selenium.remote.http.HttpClient;32import org.openqa.selenium.remote.service.DriverService;33import org.openqa.selenium.remote.tracing.Tracer;34import java.util.ArrayList;35import java.util.Collection;36import java.util.List;37import java.util.ServiceLoader;38public class LocalNodeFactory {39 public static Node create(Config config) {40 LoggingOptions loggingOptions = new LoggingOptions(config);41 EventBusOptions eventOptions = new EventBusOptions(config);42 BaseServerOptions serverOptions = new BaseServerOptions(config);43 NodeOptions nodeOptions = new NodeOptions(config);44 NetworkOptions networkOptions = new NetworkOptions(config);45 Tracer tracer = loggingOptions.getTracer();46 HttpClient.Factory clientFactory = networkOptions.getHttpClientFactory(tracer);47 LocalNode.Builder builder = LocalNode.builder(48 tracer,49 eventOptions.getEventBus(),50 serverOptions.getExternalUri(),51 nodeOptions.getPublicGridUri().orElseGet(serverOptions::getExternalUri),52 serverOptions.getRegistrationSecret());53 List<DriverService.Builder<?, ?>> builders = new ArrayList<>();54 ServiceLoader.load(DriverService.Builder.class).forEach(builders::add);55 nodeOptions.getSessionFactories(info -> createSessionFactory(tracer, clientFactory, builders, info))56 .forEach((caps, factories) -> factories.forEach(factory -> builder.add(caps, factory)));57 new DockerOptions(config).getDockerSessionFactories(tracer, clientFactory)...