public static Calendar getCalendar(Object date, Calendar defaultValue) {
        Calendar cal = new GregorianCalendar();
        if (date instanceof java.util.Date) {
            cal.setTime((java.util.Date) date);
            return cal;
        } else if (date != null) {
            Optional<Date> d = tryToParseDate(date);
            if (!d.isPresent()) {
                return defaultValue;
            }
            cal.setTime(d.get());
        } else {
            cal = defaultValue;
        }
        return cal;
    }
@Test
    public void testGetCalendarObjectCalendarWithNullAndCalendarAsDefault() {
        Calendar cal = new GregorianCalendar();
        assertEquals(cal, Converter.getCalendar(null, cal));
    }