diff --git a/src/main/java/io/vertx/core/loadbalancing/LoadBalancer.java b/src/main/java/io/vertx/core/loadbalancing/LoadBalancer.java index ef7db797627..4d93ddb1304 100644 --- a/src/main/java/io/vertx/core/loadbalancing/LoadBalancer.java +++ b/src/main/java/io/vertx/core/loadbalancing/LoadBalancer.java @@ -32,12 +32,9 @@ public interface LoadBalancer { */ LoadBalancer ROUND_ROBIN = () -> { AtomicInteger idx = new AtomicInteger(); - return new EndpointSelector() { - @Override - public int selectEndpoint(List> endpoints) { - int next = idx.getAndIncrement(); - return next % endpoints.size(); - } + return (EndpointSelector) endpoints -> { + int next = idx.getAndIncrement(); + return next % endpoints.size(); }; };