SimpleDate implements Parcelable { private static String fixTimeZone(String string) { if (string.endsWith("Z")) { string = string.replace("Z", "+0000"); } return string; } SimpleDate(final long time); private  SimpleDate(final Date date); @Override boolean equals(final Object o); Date getDate(); CharSequence getRelativeDateTimeText(final Context context); CharSequence getRelativeTimeText(final Context context); @Override int hashCode(); boolean isInTheFuture(); @Override String toString(); @Override int describeContents(); @Override void writeToParcel(final Parcel dest, final int flags); static final Creator<SimpleDate> CREATOR; static final Comparator<SimpleDate> CHRONOLOGICAL_ORDER; static final Comparator<SimpleDate> REVERSE_CHRONOLOGICAL_ORDER; static final JsonDeserializer<SimpleDate> JSON_DESERIALIZER; static final JsonSerializer<SimpleDate> JSON_SERIALIZER; }
@Test public void testFixTimeZone() throws Exception { String string = (String) mFixTimeZone.invoke(null, AM_PM_DATE_0); assertEquals(string, AM_PM_DATE_0); string = (String) mFixTimeZone.invoke(null, AM_PM_DATE_1); assertEquals(string, AM_PM_DATE_1); string = (String) mFixTimeZone.invoke(null, AM_PM_DATE_2); assertEquals(string, AM_PM_DATE_2); string = (String) mFixTimeZone.invoke(null, EXTENDED_DATE_0); assertTrue(string.endsWith("+0000")); string = (String) mFixTimeZone.invoke(null, EXTENDED_DATE_1); assertTrue(string.endsWith("+0000")); string = (String) mFixTimeZone.invoke(null, SHORT_DATE_0); assertEquals(string, SHORT_DATE_0); string = (String) mFixTimeZone.invoke(null, SHORT_DATE_1); assertEquals(string, SHORT_DATE_1); }