MphChlOp extends Operator { static boolean isValidBrrSourceProduct(Product sourceProduct, Sensor sensor) { final String[] requiredBrrBands = sensor.getRequiredBrrBandNames(); for (String bandName : requiredBrrBands) { if (!sourceProduct.containsBand(bandName)) { return false; } } return true; }  @Override void initialize();  }
@Test public void testIsValidBrrSourceProduct() { Product sourceProduct = new Product("test", "test", 1, 1); assertFalse(MphChlOp.isValidBrrSourceProduct(sourceProduct, Sensor.MERIS_3RD)); for (String bandName : MphChlConstants.MERIS_REQUIRED_BRR_BAND_NAMES) { sourceProduct.addBand(bandName, ProductData.TYPE_FLOAT32); } assertTrue(MphChlOp.isValidBrrSourceProduct(sourceProduct, Sensor.MERIS_3RD)); assertTrue(MphChlOp.isValidBrrSourceProduct(sourceProduct, Sensor.MERIS_4TH)); assertFalse(MphChlOp.isValidBrrSourceProduct(sourceProduct, Sensor.OLCI)); for (String bandName : MphChlConstants.OLCI_REQUIRED_BRR_BAND_NAMES) { if (!sourceProduct.containsBand(bandName)) { sourceProduct.addBand(bandName, ProductData.TYPE_FLOAT32); } } assertTrue(MphChlOp.isValidBrrSourceProduct(sourceProduct, Sensor.OLCI)); }