Implement Interceptor Request

Hello, I have to study the request XMPP, to modify the property of security, then first I have to implement an interceptor packet that intercept the packet send from an application using XMPP, but I don’t know how to do it. I saw that in the api Smack we have PacketInterceptor interface, class of addPacketInterceptor but I don’t found example. Someone can help me please?