@Override
        public void onAction(String name, boolean pressed, float tpf) {
            if (name.equals("clone") && !pressed) {

                Terrain clone = (Terrain) ((Node)terrain).clone();
                ((Node)terrain).removeFromParent();
                terrain = clone;
                getRootNode().attachChild((Node)terrain);
            }
        }
Create the save and load actions and add them to the input listener
jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java