From 844ea8eb96f762372e6985ed9b05149c4073d9b8 Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Thu, 18 Jan 2018 00:04:31 +0300 Subject: [PATCH] Modernization of pre Java 6 code --- .../DefaultProxyIsUnregisteredIfDownForTooLongTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/server/test/org/openqa/grid/e2e/node/DefaultProxyIsUnregisteredIfDownForTooLongTest.java b/java/server/test/org/openqa/grid/e2e/node/DefaultProxyIsUnregisteredIfDownForTooLongTest.java index e49675dda7c7a..42fce4461b9e4 100644 --- a/java/server/test/org/openqa/grid/e2e/node/DefaultProxyIsUnregisteredIfDownForTooLongTest.java +++ b/java/server/test/org/openqa/grid/e2e/node/DefaultProxyIsUnregisteredIfDownForTooLongTest.java @@ -37,7 +37,6 @@ import org.openqa.selenium.remote.server.SeleniumServer; import org.openqa.selenium.support.ui.FluentWait; -import java.util.Iterator; import java.util.concurrent.Callable; public class DefaultProxyIsUnregisteredIfDownForTooLongTest { @@ -115,9 +114,8 @@ public Boolean call() throws Exception { private String getProxyId() throws Exception { RemoteProxy p = null; - Iterator it = registry.getAllProxies().iterator(); - while(it.hasNext()) { - p = it.next(); + for (RemoteProxy remoteProxy : registry.getAllProxies()) { + p = remoteProxy; } if (p == null) { throw new Exception("Unable to find registered proxy at hub");