protected Vector3f getMeshNormal(int x, int z) {
        if (x >= size || z >= size)
            return null; // out of range

        int index = (z*size+x)*3;
        FloatBuffer nb = (FloatBuffer)this.getMesh().getBuffer(Type.Normal).getData();
        Vector3f normal = new Vector3f();
        normal.x = nb.get(index);
        normal.y = nb.get(index+1);
        normal.z = nb.get(index+2);
        return normal;
    }
Matches the normals along the edge of the patch with the neighbours.
Computes the normals for the right, bottom, left, and top edges of the
patch, and saves those normals in the neighbour's edges too.

Takes 4 points (if it has a neighbour on that side) for each
point on the edge of the patch:
             *
             |
         *---x---*
             |
             *
It works across the right side of the patch, from the top down to
the bottom. Then it works on the bottom side of the patch, from the
left to the right.
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java