### Question:
CoregistrationOp extends Operator { public CoregistrationOp() { } CoregistrationOp(); @Override Dimension ensureSingleRasterSize(Product... products); @Override void setParameter(String name, Object value); @Override void initialize(); @Override void doExecute(ProgressMonitor pm); public String hiddenSlaveBand; }### Answer:
@Test public void testCoregistrationOp() throws Exception { Map<String, Object> parameters = new HashMap<>(); parameters.put("slaveSourceBand", slaveSourceProduct.getBand("gray").getName()); parameters.put("masterSourceBand",masterSourceProduct.getBand("gray").getName()); parameters.put("levels", 6); parameters.put("rank", 4); parameters.put("iterations", 2); parameters.put("radius", "32, 28, 24, 20, 16, 12, 8"); Map<String, Product> sourceProducts = new HashMap<String, Product>(); sourceProducts.put("Master", masterSourceProduct); sourceProducts.put("Slave", slaveSourceProduct); Operator operator = GPF.getDefaultInstance().createOperator("CoregistrationOp", parameters, sourceProducts, null); operator.execute(ProgressMonitor.NULL); Product targetProduct = operator.getTargetProduct(); assertNotNull(targetProduct); assertEquals(402, targetProduct.getSceneRasterWidth()); assertEquals(271, targetProduct.getSceneRasterHeight()); assertEquals(slaveSourceProduct.getNumBands(), targetProduct.getNumBands()); Band bandGray = targetProduct.getBandAt(0); Band bandRed = targetProduct.getBandAt(1); Band bandGreen = targetProduct.getBandAt(2); Band bandBlue = targetProduct.getBandAt(3); assertNotNull(bandGray); assertNotNull(bandRed); assertNotNull(bandGreen); assertNotNull(bandBlue); assertEquals(ProductData.TYPE_FLOAT32, bandGray.getDataType()); assertEquals(ProductData.TYPE_FLOAT32, bandBlue.getDataType()); assertEquals(ProductData.TYPE_FLOAT32, bandGreen.getDataType()); assertEquals(ProductData.TYPE_FLOAT32, bandRed.getDataType()); long size = targetProduct.getSceneRasterWidth() * targetProduct.getSceneRasterHeight(); assertEquals(size, bandGray.getNumDataElems()); checkGrayBand(bandGray); }