@Test public void testToStringForTimeZone_fromApiDate() { Assert.assertEquals( stringDateTime1, DateTimes.toStringForTimeZone(apiDateTime1, TIME_ZONE_ID1)); Assert.assertEquals( stringDateTime2, DateTimes.toStringForTimeZone(apiDateTime2, TIME_ZONE_ID2)); Assert.assertEquals( stringDateTime3, DateTimes.toStringForTimeZone(apiDateTime3, TIME_ZONE_ID3)); Assert.assertEquals( stringDateTime1, DateTimes.toStringForTimeZone( DateTimes.toDateTime(jodaDateTime1.withZone(DateTimeZone.forID(TIME_ZONE_ID2))), TIME_ZONE_ID1)); Assert.assertEquals( stringDateTime2, DateTimes.toStringForTimeZone( DateTimes.toDateTime(jodaDateTime2.withZone(DateTimeZone.forID(TIME_ZONE_ID1))), TIME_ZONE_ID2)); Assert.assertEquals( stringDateTime3, DateTimes.toStringForTimeZone( DateTimes.toDateTime(jodaDateTime3.withZone(DateTimeZone.forID(TIME_ZONE_ID1))), TIME_ZONE_ID3)); }