### Question:
MovingWindow { public MovingWindow(IntMatrix colorFillerMatrix) { this.colorFillerMatrix = colorFillerMatrix; this.validSegmentIds = new IntOpenHashSet(); this.invalidSegmentIds = new IntOpenHashSet(); } MovingWindow(IntMatrix colorFillerMatrix); IntSet runTile(int tileLeftX, int tileTopY, int tileRightX, int tileBottomY);  }### Answer:
@Test public void testMovingWindow() throws Exception { Dimension tileSize = JAI.getDefaultTileSize(); int threadCount = Runtime.getRuntime().availableProcessors() - 1; ExecutorService threadPool = Executors.newCachedThreadPool(); ProductReaderPlugIn productReaderPlugIn = buildDimapProductReaderPlugIn(); Path folder = this.forestCoverChangeTestsFolderPath.resolve("object-selection"); File currentProductFile = folder.resolve("S2A_20160713T125925_A005524_T35UMP_grm.dim").toFile(); Product segmentationProduct = productReaderPlugIn.createReaderInstance().readProductNodes(currentProductFile, null); assertNotNull(segmentationProduct); IntSet validRegions = buildValidRegions(); ProductBandToMatrixConverter converter = new ProductBandToMatrixConverter(segmentationProduct, tileSize.width, tileSize.height); IntMatrix segmentationMatrix = converter.runTilesInParallel(threadCount, threadPool); assertNotNull(segmentationMatrix); ColorFillerTilesComputing tilesComputing = new ColorFillerTilesComputing(segmentationMatrix, validRegions, null, null, tileSize.width, tileSize.height); IntMatrix colorFillerMatrix = tilesComputing.runTilesInParallel(threadCount, threadPool); assertNotNull(colorFillerMatrix); assertEquals(549, colorFillerMatrix.getColumnCount()); assertEquals(549, colorFillerMatrix.getRowCount()); MovingWindow movingWindow = new MovingWindow(colorFillerMatrix); IntSet validSegmentIds = movingWindow.runTile(0, 0, 512, 512); assertNotNull(validSegmentIds); assertEquals(14, validSegmentIds.size()); assertTrue(validSegmentIds.contains(293)); assertTrue(validSegmentIds.contains(1200)); assertTrue(validSegmentIds.contains(800)); assertTrue(validSegmentIds.contains(402)); assertTrue(validSegmentIds.contains(1)); assertTrue(validSegmentIds.contains(12)); assertTrue(validSegmentIds.contains(10)); assertTrue(validSegmentIds.contains(34)); assertTrue(validSegmentIds.contains(117)); assertTrue(validSegmentIds.contains(45)); assertTrue(validSegmentIds.contains(63)); assertTrue(validSegmentIds.contains(1005)); assertTrue(validSegmentIds.contains(53)); assertTrue(validSegmentIds.contains(20)); }