diff --git a/java/client/src/org/openqa/selenium/json/JsonOutput.java b/java/client/src/org/openqa/selenium/json/JsonOutput.java index 0dac9a15aa8bc..5228a44ff277b 100644 --- a/java/client/src/org/openqa/selenium/json/JsonOutput.java +++ b/java/client/src/org/openqa/selenium/json/JsonOutput.java @@ -37,7 +37,6 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; -import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; @@ -262,7 +261,7 @@ public JsonOutput write(Object input, int depthRemaining) { .findFirst() .map(Map.Entry::getValue) .orElseThrow(() -> new JsonException("Unable to write " + input)) - .accept(input, depthRemaining); + .consume(input, depthRemaining); return this; } @@ -416,16 +415,7 @@ public void write(String text) { } @FunctionalInterface - private interface SafeBiConsumer extends BiConsumer { - void consume(T t, U u) throws IOException; - - @Override - default void accept(T t, U u) { - try { - consume(t, u); - } catch (IOException e) { - throw new JsonException(e); - } - } + private interface SafeBiConsumer { + void consume(T t, U u); } }