public boolean isPendingPingResponse(@Nonnull final Packet stanza) {
        if (!(stanza instanceof IQ)) {
            return false;
        }
        final IQ iq = (IQ) stanza;
        if (iq.isRequest()) {
            return false;
        }

        // Check if this is an error to a ghost-detection ping that we've sent out. Note that clients that are
        // connected but do not support XEP-0199 should send back a 'service-unavailable' error per the XEP, but
        // some clients are known to send 'feature-not-available'. Treat these as indications that the client is
        // still connected.
        final Collection<PacketError.Condition> pingErrorsIndicatingClientConnectivity = Arrays.asList(
            PacketError.Condition.service_unavailable,
            PacketError.Condition.feature_not_implemented
        );

        final JID jid = PINGS_SENT.get(iq.getID());
        final boolean result = jid != null && iq.getFrom().equals(jid)
            && (iq.getError() == null || pingErrorsIndicatingClientConnectivity.contains(iq.getError().getCondition()));

        if (result) {
            // If this is _not_ a valid response, 'isDeliveryRelatedErrorResponse' might want to process this. Otherwise, remove.
            PINGS_SENT.remove(iq.getID());
        }
        return result;
    }
Determines if a stanza is a client-generated response to an IQ Ping request sent by this server.

A 'true' result of this method indicates that the client sending the IQ response is currently reachable.

@param stanza The stanza to check
@return true if the stanza is a response to an IQ Ping request sent by the server, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java