Here you can find the source of infoEquals(MBeanInfo one, MBeanInfo two)
public static boolean infoEquals(MBeanInfo one, MBeanInfo two)
//package com.java2s; /******************************************************************************* * Copyright (c) 2006 Jeff Mesnil//from www . j a va 2s .com * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * "Rob Stryker" <rob.stryker@redhat.com> - Initial implementation *******************************************************************************/ import javax.management.MBeanInfo; public class Main { public static boolean infoEquals(MBeanInfo one, MBeanInfo two) { if (one == two) return true; if (!safeStringEquals(one.getClassName(), two.getClassName()) || !safeStringEquals(one.getDescription(), two.getDescription())) return false; return true; } public static boolean safeStringEquals(String one, String two) { if (one == null) return two == null; return one.equals(two); } }