@Test public void testGetBestLocalDeviceAddress() throws Exception { assertNotEquals(null, Search.getBestLocalDeviceAddress()); }
public static InetAddress getBestLocalDeviceAddress() throws NoNetworkInterfacesException { List<InetAddress> inetAddresses = new ArrayList<>(); List<NetworkInterface> networkInterfaces; try { networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.isUp() && !networkInterface.isVirtual()) { LOG.debug("[{}] {}", networkInterface.getName(), networkInterface.getDisplayName()); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); } } } catch (SocketException e) { throw new NoNetworkInterfacesException(e); } inetAddresses.sort(new InetAddressComparator()); return inetAddresses.get(inetAddresses.size() > bestAddresPointer + 1 ? inetAddresses.size() - bestAddresPointer++ : inetAddresses.size() - (bestAddresPointer = 1)); }
Search { public static InetAddress getBestLocalDeviceAddress() throws NoNetworkInterfacesException { List<InetAddress> inetAddresses = new ArrayList<>(); List<NetworkInterface> networkInterfaces; try { networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.isUp() && !networkInterface.isVirtual()) { LOG.debug("[{}] {}", networkInterface.getName(), networkInterface.getDisplayName()); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); } } } catch (SocketException e) { throw new NoNetworkInterfacesException(e); } inetAddresses.sort(new InetAddressComparator()); return inetAddresses.get(inetAddresses.size() > bestAddresPointer + 1 ? inetAddresses.size() - bestAddresPointer++ : inetAddresses.size() - (bestAddresPointer = 1)); } }
Search { public static InetAddress getBestLocalDeviceAddress() throws NoNetworkInterfacesException { List<InetAddress> inetAddresses = new ArrayList<>(); List<NetworkInterface> networkInterfaces; try { networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.isUp() && !networkInterface.isVirtual()) { LOG.debug("[{}] {}", networkInterface.getName(), networkInterface.getDisplayName()); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); } } } catch (SocketException e) { throw new NoNetworkInterfacesException(e); } inetAddresses.sort(new InetAddressComparator()); return inetAddresses.get(inetAddresses.size() > bestAddresPointer + 1 ? inetAddresses.size() - bestAddresPointer++ : inetAddresses.size() - (bestAddresPointer = 1)); } private  Search(); }
Search { public static InetAddress getBestLocalDeviceAddress() throws NoNetworkInterfacesException { List<InetAddress> inetAddresses = new ArrayList<>(); List<NetworkInterface> networkInterfaces; try { networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.isUp() && !networkInterface.isVirtual()) { LOG.debug("[{}] {}", networkInterface.getName(), networkInterface.getDisplayName()); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); } } } catch (SocketException e) { throw new NoNetworkInterfacesException(e); } inetAddresses.sort(new InetAddressComparator()); return inetAddresses.get(inetAddresses.size() > bestAddresPointer + 1 ? inetAddresses.size() - bestAddresPointer++ : inetAddresses.size() - (bestAddresPointer = 1)); } private  Search(); static InetAddress getBestLocalDeviceAddress(); static List<T> expandBindings(List<T> bindings, int quantity); static List<T> expandBinding(T binding, int quantity); static Stream<InetAddress> expandPrefix(final IpPrefix prefix); static Stream<InetAddress> expandPrefix(final IpPrefix prefix, final long limit); static String getAddress(
            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address); }
Search { public static InetAddress getBestLocalDeviceAddress() throws NoNetworkInterfacesException { List<InetAddress> inetAddresses = new ArrayList<>(); List<NetworkInterface> networkInterfaces; try { networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface networkInterface : networkInterfaces) { if (networkInterface.isUp() && !networkInterface.isVirtual()) { LOG.debug("[{}] {}", networkInterface.getName(), networkInterface.getDisplayName()); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); } } } catch (SocketException e) { throw new NoNetworkInterfacesException(e); } inetAddresses.sort(new InetAddressComparator()); return inetAddresses.get(inetAddresses.size() > bestAddresPointer + 1 ? inetAddresses.size() - bestAddresPointer++ : inetAddresses.size() - (bestAddresPointer = 1)); } private  Search(); static InetAddress getBestLocalDeviceAddress(); static List<T> expandBindings(List<T> bindings, int quantity); static List<T> expandBinding(T binding, int quantity); static Stream<InetAddress> expandPrefix(final IpPrefix prefix); static Stream<InetAddress> expandPrefix(final IpPrefix prefix, final long limit); static String getAddress(
            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address);  }