src/main/java/org/jivesoftware/smack/Connection.java
public PacketCollector createPacketCollector(PacketFilter packetFilter) {
        PacketCollector collector = new PacketCollector(this, packetFilter);
        // Add the collector to the list of active collectors.
        collectors.add(collector);
        return collector;
    }
public PacketCollector createPacketCollector(PacketFilter packetFilter) {
        PacketCollector collector = new PacketCollector(this, packetFilter);
        // Add the collector to the list of active collectors.
        collectors.add(collector);
        return collector;
    }
Creates a new packet collector for this connection. A packet filter
determines which packets will be accumulated by the collector. A
PacketCollector is more suitable to use than a {@link PacketListener}
when you need to wait for a specific result.

@param packetFilter
the packet filter to use.
@return a new packet collector.