@@ -0,0 +1,2304 @@
+package org.westmalle.wayland.output;%0A%0Aimport org.freedesktop.wayland.server.WlCompositorResource;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A%0Aimport javax.media.nativewindow.util.Rectangle;%0Aimport javax.media.nativewindow.util.RectangleImmutable;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Mockito.*;%0A%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(%7B%0A                        //following classes are final, so we have to powermock them:%0A                        RegionFactory.class%0A                %7D)%0Apublic class SurfaceTest %7B%0A%0A    @Mock%0A    private RegionFactory        regionFactory;%0A    @Mock%0A    private WlCompositorResource wlCompositorResource;%0A    @InjectMocks%0A    private Surface              surface;%0A%0A    @Test%0A    public void testMarkDestroyed() throws Exception %7B%0A        //given%0A        //when%0A        this.surface.markDestroyed();%0A        //then%0A        assertThat(this.surface.isDestroyed()).isTrue();%0A    %7D%0A%0A    @Test%0A    public void testMarkDamaged() throws Exception %7B%0A        //given%0A        final Region region = mock(Region.class);%0A        when(region.add(any())).thenReturn(region);%0A        when(this.regionFactory.create()).thenReturn(region);%0A        final RectangleImmutable damage = new Rectangle(100,%0A                                                        100,%0A                                                        20,%0A                                                        50);%0A        //when%0A        this.surface.markDamaged(damage);%0A        //then%0A        verify(region,%0A               times(1)).add(damage);%0A    %7D%0A%0A    @Test%0A    public void testRemoveTransform() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testDetachBuffer() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testCommit() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testRemoveOpaqueRegion() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testRemoveInputRegion() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testFirePaintCallbacks() throws Exception %7B%0A%0A    %7D%0A%0A    @Test%0A    public void testRelativeCoordinate() throws Exception %7B%0A%0A    %7D%0A%7D

add destroy and damage tests