### Question:
DeliveryReceipt implements ExtensionElement { public static DeliveryReceipt from(Message message) { return message.getExtension(DeliveryReceipt.class); } DeliveryReceipt(String id); String getId(); @Override String getElementName(); @Override String getNamespace(); @Override XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace); @Deprecated static DeliveryReceipt getFrom(Message p); static DeliveryReceipt from(Message message); static final String NAMESPACE; static final String ELEMENT; static final QName QNAME; }### Answer:
@Test public void receiptManagerListenerTest() throws Exception { DummyConnection c = new DummyConnection(); c.connect(); DeliveryReceiptManager drm = DeliveryReceiptManager.getInstanceFor(c); TestReceiptReceivedListener rrl = new TestReceiptReceivedListener(); drm.addReceiptReceivedListener(rrl); Message m = StanzaBuilder.buildMessage("reply-id") .from("julia@capulet.com") .to("romeo@montague.com") .ofType(Message.Type.normal) .addExtension(new DeliveryReceipt("original-test-id")) .build(); c.processStanza(m); rrl.waitUntilInvocationOrTimeout(); }