@@ -0,0 +1,2371 @@
+package org.westmalle.wayland.protocol;%0A%0Aimport org.freedesktop.wayland.server.Client;%0Aimport org.freedesktop.wayland.server.WlKeyboardResource;%0Aimport org.freedesktop.wayland.server.jna.WaylandServerLibrary;%0Aimport org.freedesktop.wayland.server.jna.WaylandServerLibraryMapping;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.powermock.api.mockito.PowerMockito;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0Aimport org.westmalle.wayland.output.Keyboard;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(%7B%0A        //following classes have static methods, so we have to powermock them:%0A        WaylandServerLibrary.class,%0A%7D)%0Apublic class WlKeyboardTest %7B%0A%0A    @Mock%0A    private Keyboard keyboard;%0A%0A    @Mock%0A    private WaylandServerLibraryMapping waylandServerLibraryMapping;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        PowerMockito.mockStatic(WaylandServerLibrary.class);%0A        when(WaylandServerLibrary.INSTANCE()).thenReturn(this.waylandServerLibraryMapping);%0A    %7D%0A%0A    @Test%0A    public void testRelease() throws Exception %7B%0A        //given%0A        WlKeyboardResource wlKeyboardResource = mock(WlKeyboardResource.class);%0A        WlKeyboard wlKeyboard = new WlKeyboard(keyboard);%0A        //when%0A        wlKeyboard.release(wlKeyboardResource);%0A        //then%0A        verify(wlKeyboardResource,%0A               times(1)).destroy();%0A    %7D%0A%0A    @Test%0A    public void testCreate() throws Exception %7B%0A        //given%0A        final Client client = mock(Client.class);%0A        final int version = 4;%0A        final int id = 4;%0A        WlKeyboard wlKeyboard = new WlKeyboard(keyboard);%0A        //when%0A        final WlKeyboardResource wlKeyboardResource = wlKeyboard.create(client,%0A                                                                        version,%0A                                                                        id);%0A        //then%0A        assertThat(wlKeyboardResource).isNotNull();%0A        assertThat(wlKeyboardResource.getImplementation()).isSameAs(wlKeyboard);%0A    %7D%0A%7D

add wlkeyboard tests