DetectInstrument { private static boolean olci(Product product) { boolean isOLCI = false; List<Band> collect = Stream.of(product.getBands()).filter(p -> p.getName().matches(OLCI_L2_BANDNAME_PATTERN)).collect(Collectors.toList()); boolean checkByType = product.getProductType().contains(OLCI_PRODUCT_TYPE_START); if (collect.size() > 0 || checkByType) { isOLCI = true; } return isOLCI; }    }
@Test public void testOLCI() { Product product = new Product("dummy", "dummy", 2, 2); product.addBand("Oa01_reflectance", ProductData.TYPE_INT8); product.addBand("Oa02_reflectance", ProductData.TYPE_INT8); product.addBand("Oa03_reflectance", ProductData.TYPE_INT8); product.addBand("Oa04_reflectance", ProductData.TYPE_INT8); product.addBand("Oa05_reflectance", ProductData.TYPE_INT8); product.addBand("Oa06_reflectance", ProductData.TYPE_INT8); product.addBand("Oa07_reflectance", ProductData.TYPE_INT8); assertEquals(Instrument.OLCI, DetectInstrument.getInstrument(product)); }