Code example for GregorianCalendar

Methods: setMinimalDaysInFirstWeeksetTimeZone

0
                + "001000000000000000000000000fe488c00000000010000000000000001000000000000000000000" 
                + "0000000000000757200025b42acf317f8060854e002000078700000000c1f1c1f1e1f1e1f1f1e1f1" 
                + "e1f7708000000040001000178780000000afffff4e2f964ac0001000000009fa5240000000000000" 
                + "00000a4cb7c187571007e00060000000a000007b2000000010000000100000001fe488c000000000" 
                + "10000000500000001000000200000000178"; 
        Calendar calendar = new GregorianCalendar(1970, 1, 1, 0, 0, 0);
        calendar.setTimeZone(TimeZone.getTimeZone("GMT-08:00"));
        // Starting from ICU4.8 release, the default minimalDaysInFirstWeek changed from 4 to 1. 
        calendar.setMinimalDaysInFirstWeek(4);
        new SerializationTester<Calendar>(calendar, s).test();
    } 
 
    private void assertCalendarEquals(Calendar calendar,
            int year, int month, int day, int hour, int minute) {
        assertEquals(year, calendar.get(Calendar.YEAR));
        assertEquals(month, calendar.get(Calendar.MONTH));
        assertEquals(day, calendar.get(Calendar.DATE));
        assertEquals(hour, calendar.get(Calendar.HOUR_OF_DAY));
        assertEquals(minute, calendar.get(Calendar.MINUTE));
    }