public static Date getDate(Object date) {
        return getDate(date, Calendar.getInstance().getTime());
    }
@Test
    @SuppressWarnings("UndefinedEquals")
    public void testGetDateObjectDateWithValidStringAndNullDefault() {
        Calendar cal = new GregorianCalendar();
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Date time = cal.getTime();
        for (int formatId : new int[]{DateFormat.SHORT, DateFormat.MEDIUM,
                DateFormat.LONG, DateFormat.FULL}) {
            DateFormat formatter = DateFormat.getDateInstance(formatId);
            assertEquals(time,
                    Converter.getDate(formatter.format(time), null));
        }
    }