### Question:
NDVIProcess implements RasterProcess { @DescribeResult(name = "result", description = "A NDVI calculation on the input coverage") public GridCoverage2D execute( @DescribeParameter(name = "coverage", description = "Input GridCoverage", min = 1) GridCoverage2D coverage, @DescribeParameter( name = "redBand", description = "Red band to index, defaults to 0", min = 0, defaultValue = "0" ) Integer redIndex, @DescribeParameter( name = "nirBand", description = "Nir band index, defaults to 3", min = 0, defaultValue = "3" ) Integer nirIndex) throws ProcessException, IOException { int redBand = redIndex == null ? 0 : redIndex; int nirBand = nirIndex == null ? 3 : nirIndex; ImageWorker red = new ImageWorker(coverage.getRenderedImage()) .retainBands(new int[] {redBand}) .format(DataBuffer.TYPE_FLOAT); ImageWorker nir = new ImageWorker(coverage.getRenderedImage()) .retainBands(new int[] {nirBand}) .format(DataBuffer.TYPE_FLOAT); ImageWorker nirMinusRed = new ImageWorker(nir.getRenderedOperation()).subtract(red.getRenderedOperation()); ImageWorker nirPlusRed = new ImageWorker(nir.getRenderedOperation()).addImage(red.getRenderedOperation()); RenderedOp ndvi = divide(nirMinusRed, nirPlusRed); GridCoverageFactory coverageFactory = new GridCoverageFactory(); GridCoverage2D ndviCoverage = coverageFactory.create("NDVIProcess", ndvi, new ReferencedEnvelope(coverage.getEnvelope())); return ndviCoverage; }  @DescribeResult(name = "result", description = "A NDVI calculation on the input coverage") GridCoverage2D execute(
      @DescribeParameter(name = "coverage", description = "Input GridCoverage", min = 1)
          GridCoverage2D coverage,
      @DescribeParameter(
            name = "redBand",
            description = "Red band to index, defaults to 0",
            min = 0,
            defaultValue = "0"
          )
          Integer redIndex,
      @DescribeParameter(
            name = "nirBand",
            description = "Nir band index, defaults to 3",
            min = 0,
            defaultValue = "3"
          )
          Integer nirIndex);  }### Answer:
@Test public void testExecute() throws Exception { File testFile = new File("src/test/java/rgbnir_cropped.tiff"); GeoTiffReader geoTiffReader = new GeoTiffReader(testFile); GridCoverage2D coverage = geoTiffReader.read(new GeneralParameterValue[0]); NDVIProcess ndviProcess = new NDVIProcess(); GridCoverage2D execute = ndviProcess.execute(coverage, 0, 3); float[] value = execute.evaluate(new Point2D.Double(375239.23, 5476200.95), new float[1]); Assert.assertEquals(value[0], 0.07018983f, 0.000000001); }