### Question:
RapidEyeMetadata extends XmlMetadata { @Override public int getNumBands() { if (numBands == 0) { MetadataElement currentElement; if (((currentElement = rootElement.getElement(RapidEyeConstants.TAG_RESULT_OF)) != null) && ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_EARTH_OBSERVATION_RESULT)) != null) && ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_PRODUCT)) != null) && ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_PRODUCT_INFORMATION)) != null)) { String value = currentElement.getAttributeString(RapidEyeConstants.TAG_NUM_BANDS); try { numBands = Integer.parseInt(value); } catch (NumberFormatException e) { logger.severe(String.format("Incorrect band number in metadata. Found %s, expected numeric", value == null ? "NULL" : value)); } } } return numBands; } 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 testGetNumBands() throws Exception { assertEquals(5, metadata.getNumBands()); }