Listener class and a simple publisher for testing