PointInTime implements ReadablePartial, Serializable, Cloneable { public int compareTo(ReadablePartial o) { return compareTo((PointInTime) o); } private  PointInTime();  PointInTime(ReadablePartial readablePartial); private  PointInTime(ReadablePartial readablePartial, Precision precision);  PointInTime(String hl7DateTime);  PointInTime(int year);  PointInTime(int year, int month);  PointInTime(int year, int month, int date);  PointInTime(int year, int month, int date, int hour);  PointInTime(int year, int month, int date, int hour, int minute);  PointInTime(int year, int month, int date, int hour, int minute,
                       int second);  PointInTime(int year, int month, int date, int hour, int minute,
                       int second, int millisecond); static String toString(PointInTime t); PointInTime add(ReadablePeriod p); PointInTime add(ReadableDuration d); PointInTime addYears(int years); PointInTime addMonths(int months); PointInTime addWeeks(int weeks); PointInTime addDays(int days); PointInTime addHours(int hours); PointInTime addMilliseconds(int milliseconds); PointInTime addMinutes(int minutes); PointInTime addSeconds(int seconds); PointInTime subtract(ReadablePeriod p); PointInTime subtract(ReadableDuration d); PointInTime subtractYears(int years); PointInTime subtractMonths(int months); PointInTime subtractWeeks(int weeks); PointInTime subtractDays(int days); PointInTime subtractHours(int hours); PointInTime subtractMilliseconds(int milliseconds); PointInTime subtractMinutes(int minutes); PointInTime subtractSeconds(int seconds); ReadableDuration subtract(PointInTime t); boolean after(PointInTime t); boolean before(PointInTime t); PointInTime clone(); int compareTo(ReadablePartial o); int compareTo(PointInTime t); int size(); DateTimeFieldType getFieldType(int index); DateTimeField getField(int index); int getValue(int index); Chronology getChronology(); int get(DateTimeFieldType field); boolean isSupported(DateTimeFieldType field); DateTime toDateTime(ReadableInstant baseInstant); LocalDateTime toLocalDateTime(); LocalDate toLocalDate(); PointInTime toPointInTimeAtMidnight(); PointInTime toPointInTimeAtNoon(); boolean equals(Object obj); int getDate(); int getHour(); int getMillisecond(); int getMinute(); int getMonth(); Precision getPrecision(); int getSecond(); int getYear(); int hashCode(); boolean isDateSet(); boolean isHourSet(); boolean isMillisecondSet(); boolean isMinuteSet(); boolean isMonthSet(); boolean isSecondSet(); IntervalOfTime promote(); String toString(); static PointInTime fromCalendarFields(Calendar calendar); static PointInTime fromDateFields(Date date); static PointInTime fromLocalDate(LocalDate t); static PointInTime fromLocalDateTime(LocalDateTime t); static PointInTime now(); static PointInTime today(); static void setNowStrategy(NowStrategy factory); static void setDefaultNowStrategy();  }
@Test public void testComparisonOfSamePrecision() { PointInTime t1 = new PointInTime(1975, 7, 23); PointInTime t2 = new PointInTime(1984, 3, 11); Assert.assertTrue(t1.compareTo(t2) < 0); Assert.assertTrue(t2.compareTo(t1) > 0); t1 = new PointInTime(1975, 7, 23, 10, 30); t2 = new PointInTime(1984, 7, 23, 10, 30); Assert.assertTrue(t1.compareTo(t2) < 0); Assert.assertTrue(t2.compareTo(t1) > 0); t1 = new PointInTime(1984, 7, 22, 10); t2 = new PointInTime(1984, 7, 23, 10); Assert.assertTrue(t1.compareTo(t2) < 0); Assert.assertTrue(t2.compareTo(t1) > 0); t1 = new PointInTime(1984, 7, 23, 10); t2 = new PointInTime(1984, 7, 23, 10); Assert.assertTrue(t1.compareTo(t2) == 0); Assert.assertTrue(t2.compareTo(t1) == 0); }
@Test public void testComparisonWithNull() { PointInTime t1 = new PointInTime(1975, 7, 23); Assert.assertTrue(t1.compareTo(null) > 0); }