### Question:
DeimosMetadataInspector implements MetadataInspector { @Override public Metadata getMetadata(Path productPath) throws IOException { try (VirtualDirEx productDirectory = VirtualDirEx.build(productPath, false, true)) { MetadataList<DeimosMetadata> metadataList = DeimosProductReader.readMetadata(productDirectory); RastersMetadata rastersMetadata = DeimosProductReader.computeMaximumDefaultProductSize(metadataList, productDirectory); Metadata metadata = new Metadata(rastersMetadata.getMaximumWidh(), rastersMetadata.getMaximumHeight()); GeoCoding productGeoCoding = addGeoCoding(metadataList, productDirectory); metadata.setGeoCoding(productGeoCoding); for (int i = 0; i < metadataList.getCount(); i++) { DeimosMetadata currentMetadata = metadataList.getMetadataAt(i); String[] bandNames = currentMetadata.getBandNames(); String bandPrefix = DeimosProductReader.computeBandPrefix(metadataList.getCount(), i); int rasterBandCount = rastersMetadata.getRasterBandCount(currentMetadata); for (int bandIndex = 0; bandIndex < rasterBandCount; bandIndex++) { String bandName = bandPrefix + ((bandIndex < bandNames.length) ? bandNames[bandIndex] : ("band_" + bandIndex)); metadata.addBandName(bandName); } } metadata.addMaskName(DeimosConstants.NODATA_VALUE); metadata.addMaskName(DeimosConstants.SATURATED_VALUE); return metadata; } catch (RuntimeException | IOException exception) { throw exception; } catch (Exception exception) { throw new IOException(exception); } } DeimosMetadataInspector(); @Override Metadata getMetadata(Path productPath);  }### Answer:
@Test public void testMetadataInspector() throws URISyntaxException, IOException { assumeTrue(TestUtil.testdataAvailable()); File productFile = TestUtil.getTestFile(PRODUCTS_FOLDER + "small_deimos/DE01_SL6_22P_1T_20110228T092316_20110616T092427_DMI_0_2e9d.dim"); DeimosMetadataInspector metadataInspector = new DeimosMetadataInspector(); MetadataInspector.Metadata metadata = metadataInspector.getMetadata(productFile.toPath()); assertNotNull(metadata); assertEquals(3000, metadata.getProductWidth()); assertEquals(3000, metadata.getProductHeight()); assertNotNull(metadata.getGeoCoding()); assertNotNull(metadata.getBandList()); assertEquals(4, metadata.getBandList().size()); assertTrue(metadata.getBandList().contains("NIR")); assertTrue(metadata.getBandList().contains("Red")); assertTrue(metadata.getBandList().contains("Green")); assertTrue(metadata.getBandList().contains("band_3")); assertNotNull(metadata.getMaskList()); assertEquals(2, metadata.getMaskList().size()); assertTrue(metadata.getMaskList().contains("nodata")); assertTrue(metadata.getMaskList().contains("SATURATED")); }