@Test
public void testSimpleSurface() {

    ReferencedEnvelope bounds = new ReferencedEnvelope(0, 30, 0, 30, DefaultGeographicCRS.WGS84);
    Coordinate[] data = new Coordinate[] { 
            new Coordinate(10, 10, 100),
            new Coordinate(10, 20, 20), 
            new Coordinate(20, 10, 0), 
            new Coordinate(20, 20, 80) };
    SimpleFeatureCollection fc = createPoints(data, bounds);
    ProgressListener monitor = null;
    BarnesSurfaceProcess process = new BarnesSurfaceProcess();
    GridCoverage2D cov = process.execute(fc, // data
            "value", // valueAttr
            1000, // dataLimit
            10.0, // scale
            (Double) null, // convergence
            (Integer) 2, // passes
            (Integer) null, // minObservations
            (Double) null, // maxObservationDistance
            -999.0, // noDataValue
            1, // pixelsPerCell
            0.0, // queryBuffer
            bounds, // outputEnv
            100, // outputWidth
            100, // outputHeight
            monitor // monitor)
    );
    
    System.out.println(coverageValue(cov, 20, 20));
    double ERROR_TOL = 10;
    
    for (Coordinate p : data) {
        float covval = coverageValue(cov, p.x, p.y);
        double error = Math.abs(p.z - covval);
        assertTrue(error < ERROR_TOL);
    }
    assertEquals(1, cov.getSampleDimensions().length);
    assertEquals("values", cov.getSampleDimensions()[0].getDescription().toString());
}