DetectInstrument { private static boolean modis1km(Product product) { MetadataElement globalAttributes = product.getMetadataRoot().getElement(GLOBAL_ATTRIBUTES); return globalAttributes != null && isModis(globalAttributes) && hasModisResultion(globalAttributes, MODIS_1KM_RESOLUTION_VALUE); }    }
@Test public void testMODIS1KM() { Product product = new Product("dummy", "dummy-modis1km", 2, 2); MetadataElement root = product.getMetadataRoot(); MetadataElement globalAttributes = new MetadataElement("Global_Attributes"); globalAttributes.setAttributeString("title", "HMODISA Level-2 Data"); globalAttributes.setAttributeString("spatialResolution", "1 km"); root.addElement(globalAttributes); assertEquals(Instrument.MODIS, DetectInstrument.getInstrument(product)); }