question: public void testAddListener ( ) { SimpleListener listener1 = createMockSimpleListener ( 1 ) ; SimpleListener listener2 = createMockSimpleListener ( 1 ) ; assertEquals ( 0 , adaptor . getNumListeners ( ) ) ; adaptor . addListener ( listener1 ) ; assertEquals ( 1 , adaptor . getNumListeners ( ) ) ; adaptor . addListener ( listener2 ) ; assertEquals ( 2 , adaptor . getNumListeners ( ) ) ; adaptor . addListener ( listener1 ) ; assertEquals ( 2 , adaptor . getNumListeners ( ) ) ; List < SimpleListener > listeners = Lists . asList ( adaptor . getListeners ( ) ) ; assertEquals ( 2 , listeners . size ( ) ) ; assertTrue ( listeners . contains ( listener1 ) ) ; assertTrue ( listeners . contains ( listener2 ) ) ; EasyMock . verify ( listener1 , listener2 ) ; }
target:  Ensures that when adding a listener that the count of the number of listeners is correctly incremented and that eventFired is called immediately on the listener.