MphChlOp extends Operator { static boolean isValidL1bSourceProduct(Product sourceProduct, Sensor sensor) { for (String bandName : sensor.getRequiredRadianceBandNames()) { if (!sourceProduct.containsBand(bandName)) { return false; } } return true; }  @Override void initialize();  }
@Test public void testIsValidL1bSourceProduct() { Product sourceProduct = new Product("test", "test", 1, 1); assertFalse(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.MERIS_3RD)); for (String bandName : MphChlConstants.MERIS_REQUIRED_RADIANCE_BAND_NAMES) { sourceProduct.addBand(bandName, ProductData.TYPE_FLOAT32); } assertTrue(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.MERIS_3RD)); assertFalse(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.OLCI)); assertFalse(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.MERIS_4TH)); for (String bandName : MphChlConstants.MERIS_REQUIRED_RADIANCE_BAND_NAMES_4TH) { sourceProduct.addBand(bandName, ProductData.TYPE_FLOAT32); } assertTrue(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.MERIS_4TH)); for (String bandName : MphChlConstants.OLCI_REQUIRED_RADIANCE_BAND_NAMES) { sourceProduct.addBand(bandName, ProductData.TYPE_FLOAT32); } assertTrue(MphChlOp.isValidL1bSourceProduct(sourceProduct, Sensor.OLCI)); }