public Presence getSubscribeStanza() throws IllegalStateException {
        if (recvStatus != RecvType.SUBSCRIBE) {
            throw new IllegalStateException("Wrong receive state");
        }
        if (subscribeStanza == null) {
            Presence presence = new Presence();
            presence.setFrom(jid);
            presence.setType(Presence.Type.subscribe);
            return presence;
        } else {
            return subscribeStanza;
        }
    }
<p>Update the cached item as a copy of the given item.</p>
<p>A convenience for getting the item and setting each attribute.</p>

@param item The item who's settings will be copied into the cached copy
@throws org.jivesoftware.openfire.SharedGroupException if trying to remove shared group.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterItem.java