Source:
<code>protected void configure() { String seleniumVersion = SeleniumUtils.determineClasspathSeleniumVersion(); if (capabilities == null) { if (seleniumVersion.startsWith("2.")) { logger().info("No capabilities provided, falling back to DesiredCapabilities.chrome()"); capabilities = DesiredCapabilities.chrome(); } else { logger().info("No capabilities provided, falling back to ChromeOptions"); capabilities = new ChromeOptions(); } } if (recordingMode != VncRecordingMode.SKIP) { if (vncRecordingDirectory == null) { try { vncRecordingDirectory = Files.createTempDirectory(TC_TEMP_DIR_PREFIX).toFile(); } catch (IOException e) { logger().error("Exception while trying to create temp directory " + vncRecordingDirectory.getAbsolutePath(), e); throw new ContainerLaunchException("Exception while trying to create temp directory", e); } } if (getNetwork() == null) { withNetwork(Network.SHARED); } vncRecordingContainer = new VncRecordingContainer(this) .withVncPassword(DEFAULT_PASSWORD) .withVncPort(VNC_PORT); } <START> DockerImageName standardImageForCapabilities = getImageForCapabilities(capabilities, seleniumVersion); <END> if (customImageName != null) { customImageName.assertCompatibleWith(standardImageForCapabilities.withTag("latest")); super.setDockerImageName(customImageName.asCanonicalNameString()); } else { super.setDockerImageName(standardImageForCapabilities.asCanonicalNameString()); } String timeZone = System.getProperty("user.timezone"); if (timeZone == null || timeZone.isEmpty()) { timeZone = "Etc/UTC"; } addExposedPorts(SELENIUM_PORT, VNC_PORT); addEnv("TZ", timeZone); if (!getEnvMap().containsKey(NO_PROXY_KEY)) { addEnv(NO_PROXY_KEY, "localhost"); } setCommand("/opt/bin/entry_point.sh"); if (getShmSize() == null) { this.getBinds().add(new Bind("/dev/shm", new Volume("/dev/shm"), AccessMode.rw)); } setStartupAttempts(3); }</code><technical_language>move this code capabilities</technical_language>

Target:
protected void configure() { String seleniumVersion = SeleniumUtils.determineClasspathSeleniumVersion(); if (capabilities == null) { if (seleniumVersion.startsWith("2.")) { logger().info("No capabilities provided, falling back to DesiredCapabilities.chrome()"); capabilities = DesiredCapabilities.chrome(); } else { logger().info("No capabilities provided, falling back to ChromeOptions"); capabilities = new ChromeOptions(); } } if (recordingMode != VncRecordingMode.SKIP) { if (vncRecordingDirectory == null) { try { vncRecordingDirectory = Files.createTempDirectory(TC_TEMP_DIR_PREFIX).toFile(); } catch (IOException e) { logger().error("Exception while trying to create temp directory " + vncRecordingDirectory.getAbsolutePath(), e); throw new ContainerLaunchException("Exception while trying to create temp directory", e); } } if (getNetwork() == null) { withNetwork(Network.SHARED); } vncRecordingContainer = new VncRecordingContainer(this) .withVncPassword(DEFAULT_PASSWORD) .withVncPort(VNC_PORT); } if (customImageName != null) { customImageName.assertCompatibleWith(COMPATIBLE_IMAGES); super.setDockerImageName(customImageName.asCanonicalNameString()); } else { DockerImageName standardImageForCapabilities = getImageForCapabilities(capabilities, seleniumVersion); super.setDockerImageName(standardImageForCapabilities.asCanonicalNameString()); } String timeZone = System.getProperty("user.timezone"); if (timeZone == null || timeZone.isEmpty()) { timeZone = "Etc/UTC"; } addExposedPorts(SELENIUM_PORT, VNC_PORT); addEnv("TZ", timeZone); if (!getEnvMap().containsKey(NO_PROXY_KEY)) { addEnv(NO_PROXY_KEY, "localhost"); } setCommand("/opt/bin/entry_point.sh"); if (getShmSize() == null) { this.getBinds().add(new Bind("/dev/shm", new Volume("/dev/shm"), AccessMode.rw)); } setStartupAttempts(3); }