### Question:
BandsDifferenceOp extends Operator { public BandsDifferenceOp() { } BandsDifferenceOp(); @Override void initialize(); @Override void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, ProgressMonitor pm);  }### Answer:
@Test public void testBandsDifferenceOp() { int sceneRasterWidth = 100; int sceneRasterHeight = 100; Product firstProduct = buildFirstProduct("FirstProduct", "BandsDifference", sceneRasterWidth, sceneRasterHeight); Product secondProduct = buildSecondProduct("SecondProduct", "BandsDifference", sceneRasterWidth, sceneRasterHeight); Map<String, Product> sourceProducts = new HashMap<String, Product>(); Map<String, Object> parameters = new HashMap<>(); Operator operator = GPF.getDefaultInstance().createOperator("BandsDifferenceOp", parameters, sourceProducts, null); operator.setSourceProducts(firstProduct, secondProduct); operator.execute(ProgressMonitor.NULL); Product targetProduct = operator.getTargetProduct(); assertNotNull(targetProduct); assertEquals(targetProduct.getName(), "BandsDifference"); assertEquals(targetProduct.getProductType(), "difference"); assertEquals(targetProduct.getSceneRasterWidth(), sceneRasterWidth); assertEquals(targetProduct.getSceneRasterHeight(), sceneRasterHeight); assertEquals(targetProduct.getNumBands(), 1); Band band = targetProduct.getBandAt(0); assertNotNull(band); assertEquals(ProductData.TYPE_FLOAT32, band.getDataType()); long size = targetProduct.getSceneRasterWidth() * targetProduct.getSceneRasterHeight(); assertEquals(size, band.getNumDataElems()); float delta = 0.0f; assertEquals(2969.0f, band.getSampleFloat(34, 65), delta); assertEquals(3563.0f, band.getSampleFloat(14, 51), delta); assertEquals(-1.0f, band.getSampleFloat(1, 2), delta); assertEquals(98.0f, band.getSampleFloat(21, 23), delta); assertEquals(890.0f, band.getSampleFloat(89, 99), delta); assertEquals(-7822.0f, band.getSampleFloat(90, 12), delta); assertEquals(1187.0f, band.getSampleFloat(32, 45), delta); assertEquals(-100.0f, band.getSampleFloat(19, 19), delta); assertEquals(3959.0f, band.getSampleFloat(35, 76), delta); assertEquals(-8020.0f, band.getSampleFloat(89, 9), delta); assertEquals(-1189.0f, band.getSampleFloat(65, 54), delta); assertEquals(5147.0f, band.getSampleFloat(23, 76), delta); assertEquals(-5545.0f, band.getSampleFloat(93, 38), delta); assertEquals(-298.0f, band.getSampleFloat(47, 45), delta); assertEquals(890.0f, band.getSampleFloat(77, 87), delta); }