@@ -0,0 +1,1739 @@
+package window.listener;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.awt.event.WindowEvent;%0Aimport java.lang.reflect.Field;%0A%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static org.mockito.Mockito.*;%0A%0A/**%0A * Created by vicboma on 15/10/15.%0A */%0Apublic class WindowAdapterBaseTest %7B%0A%0A    public static final String CURRENT_RUNTIME = %22currentRuntime%22;%0A    private WindowAdapterBase windowAdapterBase;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        windowAdapterBase = WindowAdapterBase.create();%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        windowAdapterBase = null;%0A    %7D%0A%0A    @Test%0A    public void testCreate() throws Exception %7B%0A        windowAdapterBase = new WindowAdapterBase();%0A        assertNotNull(%22Is null%22,windowAdapterBase);%0A    %7D%0A%0A    @Test%0A    public void testWindowClosing() throws Exception %7B%0A        final Runtime spyRuntime = magiaCincoEstrellas();%0A%0A        final WindowAdapterBase _spy = spy(windowAdapterBase);%0A        final WindowEvent winClosingEvent = mock(WindowEvent.class);%0A%0A        doNothing().when(spyRuntime).exit(anyInt());%0A%0A        _spy.windowClosing(winClosingEvent);%0A        verify(_spy).windowClosing(winClosingEvent);%0A    %7D%0A%0A    private Runtime magiaCincoEstrellas() throws NoSuchFieldException, IllegalAccessException %7B%0A        final Runtime originalRuntime = Runtime.getRuntime();%0A        final Runtime spyRuntime  = spy(originalRuntime);%0A        final Field currentRuntime = Runtime.class.getDeclaredField(CURRENT_RUNTIME);%0A        currentRuntime.setAccessible(true);%0A        currentRuntime.set(originalRuntime, spyRuntime);%0A        currentRuntime.setAccessible(false);%0A        return spyRuntime;%0A    %7D%0A%7D

add Test WindowAdapterBase