### Question:
ASTimeZoneConverterImpl implements ASTimeZoneConverter { @Override public Optional<TimeZone> convert(ASTimeZone asTimeZone) { return FluentIterable.from(matchJavaTimeZones(asTimeZone)).first(); } @Inject @VisibleForTesting  ASTimeZoneConverterImpl(TimeZoneConverter timeZoneConverter); @Override Optional<TimeZone> convert(ASTimeZone asTimeZone);  }### Answer:
@Test public void testConvertEuropeParisTimeZone() { TimeZone timeZone = TimeZone.getTimeZone("Europe/Paris"); ASTimeZone asTimeZone = toASTimeZone(timeZone); Optional<TimeZone> expectedTimeZone = asTimeZoneConverter.convert(asTimeZone); assertThat(expectedTimeZone).isPresent(); assertThat(expectedTimeZone.get()).isEqualTo(timeZone); }
@Test public void testConvertGS2LosAngelesTimeZone() { TimeZone timeZone = TimeZone.getTimeZone("America/Los_Angeles"); Optional<TimeZone> expectedTimeZone = asTimeZoneConverter.convert(gs2LosAngelesTimeZone()); assertThat(expectedTimeZone).isPresent(); assertThat(expectedTimeZone.get()).isEqualTo(timeZone); }
@Test public void testConvertAllTimeZonePreferences() { Map<String, TimeZone> map = Maps.newHashMap(); for (String tZI : ASTimeZoneConverterImpl.TIME_ZONE_PREFERENCES) { TimeZone timeZone = TimeZone.getTimeZone(tZI); ASTimeZone asTimeZone = toASTimeZone(timeZone); TimeZone expectedTimeZone = asTimeZoneConverter.convert(asTimeZone).get(); map.put(tZI, expectedTimeZone); } assertTimezoneIdsAreCorrect(map); }
@Test public void testConvertDefaultValue() { Base64ASTimeZoneDecoderImpl base64asTimeZoneDecoderImpl = new Base64ASTimeZoneDecoderImpl(new WCHAREncoder(), new IntEncoder(), new SystemTimeEncoder()); ASTimeZone asTimeZone = base64asTimeZoneDecoderImpl.decode("xP Optional<TimeZone> expectedTimeZone = asTimeZoneConverter.convert(asTimeZone); assertThat(expectedTimeZone).isAbsent(); }