@@ -0,0 +1,1915 @@
+/*%0A * Copyright (C) 2013 Klaus Reimer %3Ck@ailis.de%3E%0A * See LICENSE.md for licensing information.%0A */%0A%0Apackage de.ailis.usb4java;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertSame;%0A%0Aimport org.junit.Test;%0A%0Aimport de.ailis.usb4java.descriptors.SimpleUsbDeviceDescriptor;%0A%0A/**%0A * Tests the %7B@link DeviceId%7D class.%0A * %0A * @author Klaus Reimer (k@ailis.de)%0A */%0Apublic class DeviceIdTest%0A%7B%0A    /** A zero byte used in the dummy descriptor. */%0A    private static final byte ZERO = 0;%0A%0A    /** A dummy device descriptor. */%0A    private static final SimpleUsbDeviceDescriptor descriptor =%0A        new SimpleUsbDeviceDescriptor(ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,%0A            ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO);%0A%0A    /**%0A     * Tests the constructor without a descriptor.%0A     */%0A    @Test(expected = IllegalArgumentException.class)%0A    public void testConstructorWithoutDescriptor()%0A    %7B%0A        assertNotNull(new DeviceId(0, 1, 2, null));%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link DeviceId#getBusNumber()%7D method.%0A     */%0A    @Test%0A    public void testGetBusNumber()%0A    %7B%0A        assertEquals(1, new DeviceId(1, 2, 3, descriptor).getBusNumber());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link DeviceId#getDeviceAddress()%7D method.%0A     */%0A    @Test%0A    public void testGetDeviceAddress()%0A    %7B%0A        assertEquals(2, new DeviceId(1, 2, 3, descriptor).getDeviceAddress());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link DeviceId#getPortNumber()%7D method.%0A     */%0A    @Test%0A    public void testGetPortNumber()%0A    %7B%0A        assertEquals(3, new DeviceId(1, 2, 3, descriptor).getPortNumber());%0A    %7D%0A%0A    /**%0A     * Tests the %7B@link DeviceId#getDeviceDescriptor()%7D method.%0A     */%0A    @Test%0A    public void testGetDeviceDescriptor()%0A    %7B%0A        assertSame(descriptor,%0A            new DeviceId(1, 2, 3, descriptor).getDeviceDescriptor());%0A    %7D%0A%7D%0A

Add unit test for DeviceId