### Question:
I18nDataExtractor implements DataExtractor { @Override public Date extractDate(Map<XmlNodeName, String> trackValues, XmlNodeName key) { if (trackValues.get(key) == null) { return null; } else { return parser.parseDateTime(trackValues.get(key)).toDate(); } }  @Override RatingTo extractRating(Map<XmlNodeName, String> trackValues,
			XmlNodeName key); @Override int extractInt(Map<XmlNodeName, String> trackValues, XmlNodeName key); @Override Boolean extractBoolean(Map<XmlNodeName, String> trackValues,
			XmlNodeName key); @Override String extractString(Map<XmlNodeName, String> trackValues,
			XmlNodeName key); @Override Date extractDate(Map<XmlNodeName, String> trackValues,
			XmlNodeName key); void setEnglishValuesProvider(
			EnglishValuesProvider englishValuesProvider);  }### Answer:
@Test public void shouldExtractNotNullDateWhenKeyNotPresent() { trackValues.put(XmlNodeName.COMPOSER, "2009-04-09T21:31:52Z"); assertEquals(1239312712000L, dataExtractor.extractDate(trackValues, XmlNodeName.COMPOSER) .getTime()); }
@Test public void shouldExtractNullDateWhenKeyNotPresent() { assertNull(dataExtractor.extractDate(trackValues, XmlNodeName.COMPOSER)); }