### Question:
WorldView2Metadata extends XmlMetadata { @Override public ProductData.UTC getProductEndTime() { ProductData.UTC date = null; String value = null; try { value = getAttributeValue(WorldView2Constants.PATH_END_TIME, null); } catch (Exception e) { warn(MISSING_ELEMENT_WARNING, WorldView2Constants.PATH_END_TIME); } if (value != null && !value.isEmpty()) { date = DateHelper.parseDate(value, WorldView2Constants.WORLDVIEW2_UTC_DATE_FORMAT); } return date; } WorldView2Metadata(String name); @Override int getNumBands(); @Override String getProductName(); @Override String getFormatName(); @Override int getRasterWidth(); @Override int getRasterHeight(); @Override String[] getRasterFileNames(); @Override ProductData.UTC getProductStartTime(); @Override ProductData.UTC getProductEndTime(); @Override ProductData.UTC getCenterTime(); @Override String getProductDescription(); @Override String getFileName(); @Override String getMetadataProfile(); String getOrderNumber(); String[] findSubProductNames(); void addSubProductTileMetadataList(String subProductName, TileMetadataList tileMetadataList); void sortSubProductsByName(); int getSubProductCount(); String getSubProductNameAt(int index); TileMetadataList getSubProductTileMetadataListAt(int index); Dimension computeDefaultProductSize(); boolean isMultiSize(); CrsGeoCoding buildProductGeoCoding(Rectangle subsetBounds); static final String EXCLUSION_STRING; }### Answer:
@Test public void testGetProductEndTime() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); Date expectedDate = sdf.parse("2017-05-02 09:14:08.999"); assertEquals(999000, metadata.getProductEndTime().getMicroSecondsFraction()); assertEquals(expectedDate.getTime(), metadata.getProductEndTime().getAsDate().getTime()); }