DetectInstrument { private static boolean czcs(Product product) { MetadataElement globalAttributes = product.getMetadataRoot().getElement(GLOBAL_ATTRIBUTES); if (globalAttributes != null && globalAttributes.containsAttribute("Title")) { final String title = globalAttributes.getAttributeString("Title"); if (title.equals(CZCS_TITLE)) { return true; } } return false; }    }
@Test public void testCZCS() { Product product = new Product("dummy", "dummy-czcs", 2, 2); MetadataElement root = product.getMetadataRoot(); MetadataElement dsd23 = new MetadataElement("Global_Attributes"); dsd23.setAttributeString("Title", "CZCS Level-2 Data"); root.addElement(dsd23); assertEquals(Instrument.CZCS, DetectInstrument.getInstrument(product)); }