diff --git a/java/src/org/openqa/selenium/chromium/AddHasCdp.java b/java/src/org/openqa/selenium/chromium/AddHasCdp.java index 628fb12cb0512..3b6604b54130d 100644 --- a/java/src/org/openqa/selenium/chromium/AddHasCdp.java +++ b/java/src/org/openqa/selenium/chromium/AddHasCdp.java @@ -47,20 +47,15 @@ public Class getDescribedInterface() { @Override public HasCdp getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) { - return new HasCdp() { - @Override - public Map executeCdpCommand( - String commandName, Map parameters) { - Require.nonNull("Command name", commandName); - Require.nonNull("Parameters", parameters); + return (commandName, parameters) -> { + Require.nonNull("Command name", commandName); + Require.nonNull("Parameters", parameters); - Map toReturn = - (Map) - executeMethod.execute( - EXECUTE_CDP, Map.of("cmd", commandName, "params", parameters)); + Map toReturn = + (Map) + executeMethod.execute(EXECUTE_CDP, Map.of("cmd", commandName, "params", parameters)); - return Map.copyOf(toReturn); - } + return Map.copyOf(toReturn); }; } } diff --git a/java/src/org/openqa/selenium/chromium/AddHasLaunchApp.java b/java/src/org/openqa/selenium/chromium/AddHasLaunchApp.java index c9c014769dca5..6872f02827c5c 100644 --- a/java/src/org/openqa/selenium/chromium/AddHasLaunchApp.java +++ b/java/src/org/openqa/selenium/chromium/AddHasLaunchApp.java @@ -57,13 +57,9 @@ public Class getDescribedInterface() { @Override public HasLaunchApp getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) { - return new HasLaunchApp() { - @Override - public void launchApp(String id) { - Require.nonNull("id of Chromium App", id); - - executeMethod.execute(LAUNCH_APP, Map.of("id", id)); - } + return id -> { + Require.nonNull("id of Chromium App", id); + executeMethod.execute(LAUNCH_APP, Map.of("id", id)); }; } } diff --git a/java/src/org/openqa/selenium/chromium/AddHasPermissions.java b/java/src/org/openqa/selenium/chromium/AddHasPermissions.java index b9d500a3acf63..339f39cba912e 100644 --- a/java/src/org/openqa/selenium/chromium/AddHasPermissions.java +++ b/java/src/org/openqa/selenium/chromium/AddHasPermissions.java @@ -57,15 +57,11 @@ public Class getDescribedInterface() { @Override public HasPermissions getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) { - return new HasPermissions() { - @Override - public void setPermission(String name, String value) { - Require.nonNull("Permission name", name); - Require.nonNull("Permission value", value); - - executeMethod.execute( - SET_PERMISSION, Map.of("descriptor", Map.of("name", name), "state", value)); - } + return (name, value) -> { + Require.nonNull("Permission name", name); + Require.nonNull("Permission value", value); + executeMethod.execute( + SET_PERMISSION, Map.of("descriptor", Map.of("name", name), "state", value)); }; } } diff --git a/java/src/org/openqa/selenium/safari/AddHasDebugger.java b/java/src/org/openqa/selenium/safari/AddHasDebugger.java index aa3ac1cb6b214..d7c51cbf4dc46 100644 --- a/java/src/org/openqa/selenium/safari/AddHasDebugger.java +++ b/java/src/org/openqa/selenium/safari/AddHasDebugger.java @@ -55,11 +55,6 @@ public Class getDescribedInterface() { @Override public HasDebugger getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) { - return new HasDebugger() { - @Override - public void attachDebugger() { - executeMethod.execute(ATTACH_DEBUGGER, null); - } - }; + return () -> executeMethod.execute(ATTACH_DEBUGGER, null); } }