### Question:
RapidEyeMetadata extends XmlMetadata { public ProductData.UTC getProductEndTime() { ProductData.UTC bandsEndTime = null; ProductData.UTC productEndTime = null; MetadataElement currentElement; if (isL1Product()) { if (((currentElement = rootElement.getElement(RapidEyeConstants.TAG_RESULT_OF)) != null) && ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_EARTH_OBSERVATION_RESULT)) != null)) { MetadataElement[] bandSpecificMetadataElements = currentElement.getElements(); for (MetadataElement element : bandSpecificMetadataElements) { if (RapidEyeConstants.TAG_BAND_SPECIFIC_METADATA.equals(element.getName())) { ProductData.UTC currentTime = DateHelper.parseDate(element.getAttributeString(RapidEyeConstants.TAG_END_DATE_TIME, null), RapidEyeConstants.UTC_DATE_FORMAT); if (bandsEndTime == null) { bandsEndTime = currentTime; } else if (currentTime != null && bandsEndTime.getAsCalendar().before(currentTime.getAsCalendar())) { bandsEndTime = currentTime; } } } } } if (((currentElement = rootElement.getElement(RapidEyeConstants.TAG_VALID_TIME)) != null) && ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_TIME_PERIOD)) != null)) { productEndTime = DateHelper.parseDate(currentElement.getAttributeString(RapidEyeConstants.TAG_END_POSITION, null), RapidEyeConstants.UTC_DATE_FORMAT); } if (productEndTime != null && bandsEndTime != null && !productEndTime.equalElems(bandsEndTime)) { logger.warning(String.format("Product end time [%s] is different from bands end time [%s]. Bands end time will be used.", productEndTime.toString(), bandsEndTime.toString())); productEndTime = bandsEndTime; } return productEndTime; } RapidEyeMetadata(String name); @Override String getFileName(); @Override int getNumBands(); @Override String getProductName(); @Override String getFormatName(); @Override String getMetadataProfile(); @Override String getProductDescription(); @Override int getRasterWidth(); @Override int getRasterHeight(); String getBrowseFileName(); String getMaskFileName(); @Override String[] getRasterFileNames(); SpatialReferenceSystem getReferenceSystem(); ProductData.UTC getProductStartTime(); ProductData.UTC getProductEndTime(); ProductData.UTC getCenterTime(); float getScaleFactor(int bandIndex); int getPixelFormat(); float[] getCornersLatitudes(); float[] getCornersLongitudes(); RationalCoefficients getRationalPolinomialCoefficients();  }### 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("2009-04-16 10:49:22.244"); assertEquals(expectedDate.getTime(), metadata.getProductEndTime().getAsDate().getTime()); assertEquals(244296, metadata.getProductEndTime().getMicroSecondsFraction()); }