Reusing existing method instead of an expression
@@ -202,11 +202,11 @@ private static CommandExecutor toExecutor(FirefoxOptions options) {
if (options.isLegacy()) {
builder = XpiDriverService.builder()
- .withBinary(options.getBinaryOrNull().orElseGet(FirefoxBinary::new))
+ .withBinary(options.getBinary())
.withProfile(options.getProfile());
} else {
builder = new GeckoDriverService.Builder()
- .usingFirefoxBinary(options.getBinaryOrNull().orElseGet(FirefoxBinary::new));
+ .usingFirefoxBinary(options.getBinary());
}
return new DriverCommandExecutor(builder.build());
