package ca.six.jtest.finalt;

import org.junit.Test;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class AppleFactoryTest {

    @Test
    public void addListener(){
        AppleAgentListener listener = new AppleAgentListener() { /* do something */ };
        AppleAgent agent = mock(AppleAgent.class);
        AppleFactory factory = new AppleFactory(agent);
        factory.addListener(listener);

        verify(agent.listeners).add(listener);
    }
}
@@ -43,24 +43,76 @@
 unit.Test;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import stati
@@ -182,16 +182,126 @@
 erify;%0A%0A
+import static org.mockito.Mockito.RETURNS_SMART_NULLS;%0Aimport static org.mockito.Mockito.RETURNS_DEEP_STUBS;%0A%0A
 public c
@@ -453,16 +453,80 @@
 g */ %7D;%0A
+        List%3CAppleAgentListener%3E listeners = new ArrayList%3C%3E();%0A
         
@@ -565,19 +565,41 @@
 nt.class
+, RETURNS_SMART_NULLS
 );%0A
+%0A
         
@@ -684,16 +684,46 @@
 stener);
+ // agent.listeners%E6%98%AF%E7%A9%BA%E7%9A%84, %E8%BF%99%E4%BC%9A%E6%8A%A5NPE
 %0A%0A      

test a final memeber: failed, NullPointerException. RETURNS_SMART_NULLS does not work