protected void reIndexGeometry(HashMap<String,UpdatedTerrainPatch> updated, boolean useVariableLod) {

        UpdatedTerrainPatch utp = updated.get(getName());

        if (utp != null && utp.isReIndexNeeded() ) {
            int pow = (int) Math.pow(2, utp.getNewLod());
            boolean left = utp.getLeftLod() > utp.getNewLod();
            boolean top = utp.getTopLod() > utp.getNewLod();
            boolean right = utp.getRightLod() > utp.getNewLod();
            boolean bottom = utp.getBottomLod() > utp.getNewLod();

            IndexBuffer idxB;
            if (useVariableLod)
                idxB = geomap.writeIndexArrayLodVariable(pow, (int) Math.pow(2, utp.getRightLod()), (int) Math.pow(2, utp.getTopLod()), (int) Math.pow(2, utp.getLeftLod()), (int) Math.pow(2, utp.getBottomLod()), totalSize);
            else
                idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize);

            Buffer b = idxB.getBuffer();
            utp.setNewIndexBuffer(b);
        }

    }
The maximum lod supported by this terrain patch.
If the patch size is 32 then the returned value would be log2(32)-2 = 3
You can then use that value, 3, to see how many times you can divide 32 by 2
before the terrain gets too un-detailed (can't stitch it any further).
@return the maximum LOD
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java