for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) { ... }