@Override
    public void simpleInitApp() {
        flyCam.setEnabled(false);

        lightsBO = new StructStd140BufferObject(lights);
        lightsBO2 = lightsBO.clone();
        
        Material mat = new Material(assetManager, "jme3test/ubo/TestUBO.j3md");
        mat.setUniformBufferObject("TestStruct1", lightsBO);
        mat.setUniformBufferObject("TestStruct2", lightsBO2);

        Geometry geo = new Geometry("Test", new Box(1, 1, 1));
        geo.setMaterial(mat);
        rootNode.attachChild(geo);
        geo.setLocalTranslation(0, 0, 1);
        
        cam.lookAt(geo.getWorldTranslation(), Vector3f.UNIT_Y);
    }
This is an example of UBO usage and an unit test for the Struct Buffer Object.
If everything works as expected, a green square should appear, if not the square will be red.

RenderDOC can be used to see the UBO on the gpu.
jme3-examples/src/main/java/jme3test/material/TestUBO.java