ServiceDate implements Serializable, Comparable<ServiceDate> { public long difference(ServiceDate serviceDate) { return (serviceDate.getAsDate(_utcTimeZone).getTime() - getAsDate( _utcTimeZone).getTime()) / (24 * 60 * 60 * 1000); } ServiceDate(int year, int month, int day);  ServiceDate(ServiceDate o);  ServiceDate(Calendar calendar);  ServiceDate(Date date);  ServiceDate(); static ServiceDate parseString(String value); int getYear(); int getMonth(); int getDay(); Date getAsDate(); Calendar getAsCalendar(TimeZone timeZone); Date getAsDate(TimeZone timeZone); String getAsString(); ServiceDate next(); ServiceDate previous(); ServiceDate shift(int numberOfDays); long difference(ServiceDate serviceDate); @Override int compareTo(ServiceDate o); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static void moveCalendarToServiceDate(Calendar c);  }
@Test public void testDifference() { assertEquals(2, new ServiceDate(2012, 03, 05).difference(new ServiceDate(2012, 03, 07))); assertEquals(-2, new ServiceDate(2012, 03, 07).difference(new ServiceDate(2012, 03, 05))); assertEquals(10, new ServiceDate(2012, 03, 05).difference(new ServiceDate(2012, 03, 15))); assertEquals(38, new ServiceDate(2012, 03, 05).difference(new ServiceDate(2012, 04, 12))); }