Here you can find the source of isUnicastAddress(@CheckForNull InetAddress address)
public static boolean isUnicastAddress(@CheckForNull InetAddress address)
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import javax.annotation.CheckForNull; public class Main { /**//from w w w . j av a 2 s. c om * Determines whether the given address is a "useful" unicast address. * * Site local is allowed. Loopback is not. */ public static boolean isUnicastAddress(@CheckForNull InetAddress address) { return (address != null) && !address.isAnyLocalAddress() && !address.isLoopbackAddress() && !address.isMulticastAddress(); } }