public RenderState extract(Stack stack, Spatial spat) {
public RenderState extract(Stack stack, SceneElement spat) {
    public RenderState extract(Stack stack, Spatial spat) {        int mode = spat.getLightCombineMode();        if (mode == REPLACE || (mode != OFF && stack.size() == 1)) // todo: use            // dummy            // state if            // off?            return (LWJGLLightState) stack.peek();        // accumulate the lights in the stack into a single LightState object        LWJGLLightState newLState = new LWJGLLightState();        Object states[] = stack.toArray();        boolean foundEnabled = false;        switch (mode) {            case COMBINE_CLOSEST:            case COMBINE_RECENT_ENABLED:                for (int iIndex = states.length - 1; iIndex >= 0; iIndex--) {                    LWJGLLightState pkLState = (LWJGLLightState) states[iIndex];                    if (!pkLState.isEnabled()) {                        if (mode == COMBINE_RECENT_ENABLED)                            break;                        else                            continue;                    } else                        foundEnabled = true;                    if (pkLState.twoSidedOn)                        newLState.setTwoSidedLighting(true);                    if (pkLState.localViewerOn)                        newLState.setLocalViewer(true);                    if (pkLState.separateSpecularOn)                        newLState.setSeparateSpecular(true);                    for (int i = 0, maxL = pkLState.getQuantity(); i < maxL; i++) {                        Light pkLight = pkLState.get(i);                        if (pkLight != null) {                            newLState.attach(pkLight);                        }                    }                }                break;            case COMBINE_FIRST:                for (int iIndex = 0, max = states.length; iIndex < max; iIndex++) {                    LWJGLLightState pkLState = (LWJGLLightState) states[iIndex];                    if (!pkLState.isEnabled())                        continue;                    else                        foundEnabled = true;                    if (pkLState.twoSidedOn)                        newLState.setTwoSidedLighting(true);                    if (pkLState.localViewerOn)                        newLState.setLocalViewer(true);                    if (pkLState.separateSpecularOn)                        newLState.setSeparateSpecular(true);                    for (int i = 0, maxL = pkLState.getQuantity(); i < maxL; i++) {                        Light pkLight = pkLState.get(i);                        if (pkLight != null) {                            newLState.attach(pkLight);                        }                    }                }                break;            case OFF:                break;        }        newLState.setEnabled(foundEnabled);        return newLState;    }