Added JUnit test for event listening.