### Question:
RapidEyeL1MetadataInspector implements MetadataInspector { @Override public Metadata getMetadata(Path productPath) throws IOException { try (VirtualDirEx productDirectory = VirtualDirEx.build(productPath, false, true)) { RapidEyeMetadata productMetadata = RapidEyeL1Reader.readMetadata(productDirectory); Metadata metadata = new Metadata(); metadata.setProductWidth(productMetadata.getRasterWidth()); metadata.setProductHeight(productMetadata.getRasterHeight()); TiePointGeoCoding productGeoCoding = RapidEyeL1Reader.buildTiePointGridGeoCoding(productMetadata, metadata.getProductWidth(), metadata.getProductHeight(), null); metadata.setGeoCoding(productGeoCoding); String[] nitfFiles = productMetadata.getRasterFileNames(); if (nitfFiles != null) { for (int i = 0; i < nitfFiles.length; i++) { String bandName = RapidEyeL1Reader.getBandName(i); metadata.getBandList().add(bandName); } } String maskFileName = productMetadata.getMaskFileName(); if (maskFileName != null) { metadata.getBandList().add(RapidEyeL1Reader.UNUSABLE_DATA_BAND_NAME); FlagCoding flagCoding = RapidEyeL1Reader.createFlagCoding(); for (String flagName : flagCoding.getFlagNames()) { metadata.getMaskList().add(flagName); } } return metadata; } catch (RuntimeException | IOException exception) { throw exception; } catch (Exception exception) { throw new IOException(exception); } } RapidEyeL1MetadataInspector(); @Override Metadata getMetadata(Path productPath);  }### Answer:
@Test public void testMetadataInspector() throws IOException { assumeTrue(TestUtil.testdataAvailable()); File productFile = TestUtil.getTestFile(PRODUCTS_FOLDER + "Demo03_1B/2009-04-16T104920_RE4_1B-NAC_3436599_84303_metadata.xml"); RapidEyeL1MetadataInspector metadataInspector = new RapidEyeL1MetadataInspector(); MetadataInspector.Metadata metadata = metadataInspector.getMetadata(productFile.toPath()); assertNotNull(metadata); assertEquals(11829, metadata.getProductWidth()); assertEquals(7422, metadata.getProductHeight()); GeoCoding geoCoding = metadata.getGeoCoding(); assertNotNull(geoCoding); CoordinateReferenceSystem coordinateReferenceSystem = geoCoding.getGeoCRS(); assertNotNull(coordinateReferenceSystem); assertNotNull(coordinateReferenceSystem.getName()); assertEquals("WGS84(DD)", coordinateReferenceSystem.getName().getCode()); assertNotNull(metadata.getBandList()); assertEquals(6, metadata.getBandList().size()); assertTrue(metadata.getBandList().contains("blue")); assertTrue(metadata.getBandList().contains("green")); assertTrue(metadata.getBandList().contains("near_infrared")); assertTrue(metadata.getBandList().contains("red")); assertTrue(metadata.getBandList().contains("red_edge")); assertTrue(metadata.getBandList().contains("unusable_data")); assertTrue(metadata.getBandList().contains("red_edge")); assertNotNull(metadata.getMaskList()); assertEquals(7, metadata.getMaskList().size()); assertTrue(metadata.getMaskList().contains("black_fill")); assertTrue(metadata.getMaskList().contains("clouds")); assertTrue(metadata.getMaskList().contains("missing_blue_data")); assertTrue(metadata.getMaskList().contains("missing_green_data")); assertTrue(metadata.getMaskList().contains("missing_nir_data")); assertTrue(metadata.getMaskList().contains("missing_red_data")); assertTrue(metadata.getMaskList().contains("missing_red_edge_data")); }