public static Change getStateChange(RosterItem.SubType itemSubType, Presence.Type action, boolean isSending) {
        Map<String, Map<Presence.Type, Change>> srTable = stateTable.get(itemSubType);
        Map<Presence.Type, Change> changeTable = srTable.get(isSending ? "send" : "recv");
        return changeTable.get(action);
    }
Determine the changes to apply to the item, according to its subscription state.
The method also turns the action and sending status into an integer code
for easier processing (switch statements).
<p>
Code relies on states being in numerical order without skipping.
In addition, the receive states must parallel the send states
so that (send state X) + STATE_RECV_SUBSCRIBE == (receive state X)
where X is subscribe, subscribed, etc.
</p>

@param  itemSubType The item to be updated
@param  action      The new state change request
@param  isSending   True if the roster owner of the item is sending the new state change request
@return Change      changes to apply to the item
xmppserver/src/main/java/org/jivesoftware/openfire/handler/PresenceSubscribeHandler.java