static private boolean checkShadowMode(RenderQueue.ShadowMode shadowMode, RenderQueue.ShadowMode desired)
    {
        if (shadowMode != RenderQueue.ShadowMode.Off)
        {
            switch (desired) {
                case Cast :
                    return shadowMode==RenderQueue.ShadowMode.Cast || shadowMode==RenderQueue.ShadowMode.CastAndReceive;
                case Receive:
                    return shadowMode==RenderQueue.ShadowMode.Receive || shadowMode==RenderQueue.ShadowMode.CastAndReceive;
                case CastAndReceive:
                    return true;
            }
        }
        return false;
    }
Helper function to distinguish between Occluders and Receivers

@param shadowMode the ShadowMode tested
@param desired the desired ShadowMode
@return true if tested ShadowMode matches the desired one
jme3-core/src/main/java/com/jme3/shadow/ShadowUtil.java