### Question:
GeneralizedTime implements Comparable<GeneralizedTime> { @Override public int compareTo( GeneralizedTime other ) { return calendar.compareTo( other.calendar ); } GeneralizedTime( Date date );  GeneralizedTime( Calendar calendar );  GeneralizedTime( long timeInMillis );  GeneralizedTime( String generalizedTime ); String toGeneralizedTime(); String toGeneralizedTimeWithoutFraction(); String toGeneralizedTime( Format format, FractionDelimiter fractionDelimiter, int fractionLength,
        TimeZoneFormat timeZoneFormat ); Calendar getCalendar(); @Override String toString(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override int compareTo( GeneralizedTime other ); long getTime(); Date getDate(); int getYear(); int getMonth(); int getDay(); int getHour(); int getMinutes(); int getSeconds(); int getFraction(); static Date getDate( String zuluTime );  }### Answer:
@Test public void testCompareTo() throws ParseException { String gt1 = "20080102121313,999Z"; GeneralizedTime generalizedTime1 = new GeneralizedTime( gt1 ); String gt2 = "20080102121314Z"; GeneralizedTime generalizedTime2 = new GeneralizedTime( gt2 ); String gt3 = "20080102121314,001Z"; GeneralizedTime generalizedTime3 = new GeneralizedTime( gt3 ); assertTrue( generalizedTime1.compareTo( generalizedTime2 ) < 0 ); assertTrue( generalizedTime1.compareTo( generalizedTime3 ) < 0 ); assertTrue( generalizedTime2.compareTo( generalizedTime3 ) < 0 ); assertTrue( generalizedTime2.compareTo( generalizedTime1 ) > 0 ); assertTrue( generalizedTime3.compareTo( generalizedTime1 ) > 0 ); assertTrue( generalizedTime3.compareTo( generalizedTime2 ) > 0 ); assertTrue( generalizedTime1.compareTo( generalizedTime1 ) == 0 ); assertTrue( generalizedTime2.compareTo( generalizedTime2 ) == 0 ); assertTrue( generalizedTime3.compareTo( generalizedTime3 ) == 0 ); }