@@ -0,0 +1,2150 @@
+/*%0A * Copyright (C) 2013 Klaus Reimer %3Ck@ailis.de%3E%0A * See LICENSE.md for licensing information.%0A */%0A%0Apackage org.usb4java;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.lang.reflect.Constructor;%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.IntBuffer;%0Aimport java.nio.LongBuffer;%0A%0Aimport org.junit.Test;%0Aimport org.usb4java.BufferUtils;%0A%0A/**%0A * Tests the %7B@link BufferUtils%7D class.%0A * %0A * @author Klaus Reimer (k@ailis.de)%0A */%0Apublic class BufferUtilsTest%0A%7B%0A    /**%0A     * Tests the %7B@link BufferUtils#allocateByteBuffer(int)%7D method.%0A     */%0A    @Test%0A    public void testAllocateByteBuffer()%0A    %7B%0A        ByteBuffer buffer = BufferUtils.allocateByteBuffer(13);%0A        assertEquals(13, buffer.limit());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link BufferUtils#allocateIntBuffer()%7D method.%0A     */%0A    @Test%0A    public void testAllocateIntBuffer()%0A    %7B%0A        IntBuffer buffer = BufferUtils.allocateIntBuffer();%0A        assertEquals(1, buffer.limit());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link BufferUtils#allocateLongBuffer()%7D method.%0A     */%0A    @Test%0A    public void testAllocateLongBuffer()%0A    %7B%0A        LongBuffer buffer = BufferUtils.allocateLongBuffer();%0A        assertEquals(1, buffer.limit());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link BufferUtils#slice(ByteBuffer, int, int)%7D method.%0A     */%0A    @Test%0A    public void testSlice()%0A    %7B%0A        ByteBuffer buffer = BufferUtils.allocateByteBuffer(10);%0A        buffer.put(new byte%5B%5D %7B 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 %7D);%0A        buffer.rewind();%0A        ByteBuffer sliced = BufferUtils.slice(buffer,  2, 3);%0A        assertEquals(3, sliced.remaining());%0A        assertEquals(3, sliced.get());%0A        assertEquals(4, sliced.get());%0A        assertEquals(5, sliced.get());%0A    %7D%0A%0A    /**%0A     * Ensure constructor is private.%0A     * %0A     * @throws Exception%0A     *             When constructor test fails.%0A     */%0A    @Test%0A    public void testPrivateConstructor() throws Exception%0A    %7B%0A        assertEquals(0, BufferUtils.class.getConstructors().length);%0A        Constructor%3C?%3E c = BufferUtils.class.getDeclaredConstructor();%0A        c.setAccessible(true);%0A        c.newInstance();%0A    %7D%0A%7D%0A

Add unit test for BufferUtils