@Override
    public void write(JmeExporter ex) throws IOException {
        OutputCapsule oc = ex.getCapsule(this);
//        oc.write(owner, "owner", null);

        ArrayList<Light> lights = new ArrayList<>();
        for (int i = 0; i < listSize; i++) {
            lights.add(list[i]);
        }
        oc.writeSavableArrayList(lights, "lights", null);
    }
Returns an iterator that can be used to iterate over this LightList.

@return an iterator that can be used to iterate over this LightList.
jme3-core/src/main/java/com/jme3/light/LightList.java