// Path: javax.usb/src/main/java/javax/usb/util/UsbUtil.java
// public static String toHexString(byte b) {
//     int i = unsignedInt(b);
//     return new String(new char[]{
//         hexDigits[i >> 4],
//         hexDigits[i & 0x0f],
//     });
// }


import static javax.usb.util.UsbUtil.toHexString;
import javax.usb.*;
import java.util.*;

            devices.addAll(foundDevices);
        }

        return devices;
    }

    public static List<UsbDevice> listUsbDevices(UsbHub usbHub) {
        List<UsbDevice> devices = new ArrayList<UsbDevice>();

        for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
            if (device.isUsbHub()) {
                continue;
            }

            devices.add(device);
        }

        for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
            if (!device.isUsbHub()) {
                continue;
            }

            devices.addAll(listUsbDevices(usbHub));
        }

        return devices;
    }

    public static String deviceIdToString(UsbDeviceDescriptor descriptor) {
// Path: javax.usb/src/main/java/javax/usb/util/UsbUtil.java
// public static String toHexString(byte b) {
//     int i = unsignedInt(b);
//     return new String(new char[]{
//         hexDigits[i >> 4],
//         hexDigits[i & 0x0f],
//     });
// }


// Path: javax.usb-extra/src/main/java/javax/usb/extra/ExtraUsbUtil.java
import static javax.usb.util.UsbUtil.toHexString;
import javax.usb.*;
import java.util.*;


            devices.addAll(foundDevices);
        }

        return devices;
    }

    public static List<UsbDevice> listUsbDevices(UsbHub usbHub) {
        List<UsbDevice> devices = new ArrayList<UsbDevice>();

        for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
            if (device.isUsbHub()) {
                continue;
            }

            devices.add(device);
        }

        for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
            if (!device.isUsbHub()) {
                continue;
            }

            devices.addAll(listUsbDevices(usbHub));
        }

        return devices;
    }

    public static String deviceIdToString(UsbDeviceDescriptor descriptor) {
        return toHexString(descriptor.idVendor()) + ":" + toHexString(descriptor.idProduct());