@Test public void getNextAvailablePort_does_not_return_special_ports() { NetworkUtils.PortAllocator portAllocator = mock(NetworkUtils.PortAllocator.class); when(portAllocator.getAvailable(any(InetAddress.class))).thenReturn(900, 2_049, 4_045, 6_000, 1_059); assertThat(getNextAvailablePort(getLoopbackAddress(), portAllocator)).isEqualTo(1_059); }
public static int getNextAvailablePort(InetAddress address) { return getNextAvailablePort(address, PortAllocator.INSTANCE); }
NetworkUtils { public static int getNextAvailablePort(InetAddress address) { return getNextAvailablePort(address, PortAllocator.INSTANCE); } }
NetworkUtils { public static int getNextAvailablePort(InetAddress address) { return getNextAvailablePort(address, PortAllocator.INSTANCE); } private  NetworkUtils(); }
NetworkUtils { public static int getNextAvailablePort(InetAddress address) { return getNextAvailablePort(address, PortAllocator.INSTANCE); } private  NetworkUtils(); static InetAddress getLocalhost(); static InetAddress getInetAddressByName(String name); static int getNextAvailablePort(InetAddress address); }
NetworkUtils { public static int getNextAvailablePort(InetAddress address) { return getNextAvailablePort(address, PortAllocator.INSTANCE); } private  NetworkUtils(); static InetAddress getLocalhost(); static InetAddress getInetAddressByName(String name); static int getNextAvailablePort(InetAddress address);  }