Here you can find the source of isValidMulticastAddress(final InetSocketAddress address)
public static boolean isValidMulticastAddress(final InetSocketAddress address)
//package com.java2s; /**//from w w w . j a v a 2 s .co m * Copyright (C) 2011-2014 Barchart, Inc. <http://www.barchart.com/> * * All rights reserved. Licensed under the OSI BSD License. * * http://www.opensource.org/licenses/bsd-license.php */ import java.net.InetSocketAddress; public class Main { public static boolean isValidMulticastAddress(final InetSocketAddress address) { return address != null && address.getAddress() != null && address.getAddress().isMulticastAddress(); } }