### Question:
AMSetupUtils { public static int getFirstUnusedPort(String hostname, int start, int increment) { for (int i = start; i < 65500; i += increment) { if (isPortInUse(hostname, i)) { return i; } } return -1; } private  AMSetupUtils(); static String readFile(ServletContext servletContext, String file); static String getRandomString(); static int getFirstUnusedPort(String hostname, int start, int increment); static boolean isPortInUse(String hostname, int port); static Map<String, String> getRemoteServerInfo(String serverUrl, String userId, String password); static InputStream getResourceAsStream(ServletContext servletContext, String file);  }### Answer:
@Test public void shouldGetFirstUnusedPort() { String hostname = "localhost"; int startPort = 10; int interval = 10; int unusedPort = getFirstUnusedPort(hostname, startPort, interval); assertThat(unusedPort).isBetween(10, 65535); }