@Sanne, I think you have been asking what this does. I am writing the expectations of calls which our listener should make to the event listener factory. eq is a matcher. It says the first argument must be equals to for example EventType.POST_INSERT. Really EventType.POST_INSERT should do, but EasyMock does not allow to mix direct method parameters with matchers. So in this case I choose matchers for all parameters. isA says that the second argument needs to be an instance of FullTextIndexEventListener.