code: public static boolean isPublicAddress(final InetAddress ia) {
          // We define public addresses by what they're not.  A public address
          // cannot be any one of the following:
          return 
              !ia.isSiteLocalAddress() &&
              !ia.isLinkLocalAddress() &&
              !ia.isAnyLocalAddress() &&
              !ia.isLoopbackAddress() &&
              !ia.isMulticastAddress();
      }
docs: Returns whether or not the specified address represents an address on
  the public Internet.
  
  @param ia The address to check.
  @return <code>true</code> if the address is an address on the public
  Internet, otherwise <code>false</code>.