How do I find if the month and year of 2 dates are equal?

This example shows you how to find if the month and year of 2 dates are equal..
package net.javaiq.examples.date;

import java.text.SimpleDateFormat;

import java.util.Calendar;
import java.util.Date;

/**
 * This class demonstrates on how to find if the month and year of 2 dates are equal. 
 * @author JavaIQ.net
 * Creation Date Dec 10, 2010
 */
public class MonthYearEqualityChecker {

    /**
     * Checks whether the month and year of input dates are equal
     */
    public static boolean checkIfMonthAndYearAreEqual(Date firstDate, Date secondDate) {
        boolean isEqual = false;

        if (firstDate != null && secondDate != null) {
            Calendar firstCal = Calendar.getInstance();
            firstCal.setTime(firstDate);
            Calendar secondCal = Calendar.getInstance();
            secondCal.setTime(secondDate);
            isEqual = 
                    firstCal.get(Calendar.YEAR) == secondCal.get(Calendar.YEAR) && firstCal.get(Calendar.MONTH) == 
                    secondCal.get(Calendar.MONTH);
        }

        return isEqual;
    }

    /**
     * Method to test other methods in the class with sample inputs
     * @param args
     */
    public static void main(String[] args) throws Exception {
        Date firstDate = new SimpleDateFormat("MM-dd-yyyy").parse("12-10-2010");
        Date secondDate = new SimpleDateFormat("MM-dd-yyyy").parse("12-18-2010");
        boolean isEqual = checkIfMonthAndYearAreEqual(firstDate, secondDate);

        if (isEqual) {
            System.out.println("Month and year of the passed dates are equal.");
        } else {
            System.out.println("Month and year of the passed dates are not equal.");
        }

        secondDate = new SimpleDateFormat("MM-dd-yyyy").parse("12-18-2011");

        isEqual = checkIfMonthAndYearAreEqual(firstDate, secondDate);

        if (isEqual) {
            System.out.println("Month and year of the passed dates are equal.");
        } else {
            System.out.println("Month and year of the passed dates are not equal.");
        }

    }
}