// Path: javax.usb-extra/src/main/java/javax/usb/extra/ExtraUsbUtil.java
// public static UsbDevice findUsbDevice(UsbHub usbHub, short idVendor, short idProduct) {
//     for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
//         if (device.isUsbHub()) {
//             continue;
//         }
// 
//         UsbDeviceDescriptor deviceDescriptor = device.getUsbDeviceDescriptor();
// 
//         if (isUsbDevice(deviceDescriptor, idVendor, idProduct)) {
//             return device;
//         }
//     }
// 
//     for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
//         if (!device.isUsbHub()) {
//             continue;
//         }
// 
//         UsbDevice foundDevice = findUsbDevice((UsbHub) device, idVendor, idProduct);
// 
//         if (foundDevice != null) {
//             return foundDevice;
//         }
//     }
// 
//     return null;
// }
// 
// Path: usbtools/src/main/java/io/trygvis/usb/tools/UsbCliUtil.java
// public static void listDevices(UsbHub hub, short idVendor, short idProduct) {
//     listDevices("0", hub, idVendor, idProduct);
// }


import static java.util.Arrays.asList;
import static javax.usb.extra.ExtraUsbUtil.findUsbDevice;
import static io.trygvis.usb.tools.UsbCliUtil.listDevices;
import javax.usb.*;
import java.util.*;
package io.trygvis.usb.tools.ztex;



public class MemTest {
    public static final short idVendor = (short)0x221a;
    public static final short idProduct = (short)0x0100;

    public static void main(String[] a) throws UsbException {
        UsbServices usbServices = UsbHostManager.getUsbServices();
        UsbHub hub = usbServices.getRootUsbHub();

        System.out.println("MemTest");

        List<String> args = new ArrayList<String>(asList(a));
        Iterator<String> it = args.iterator();
        while (it.hasNext()) {
            String arg = it.next();
            if (arg.equals("--list")) {
                listDevices(hub, idVendor, idProduct);
                break;
            } else {
// Path: javax.usb-extra/src/main/java/javax/usb/extra/ExtraUsbUtil.java
// public static UsbDevice findUsbDevice(UsbHub usbHub, short idVendor, short idProduct) {
//     for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
//         if (device.isUsbHub()) {
//             continue;
//         }
// 
//         UsbDeviceDescriptor deviceDescriptor = device.getUsbDeviceDescriptor();
// 
//         if (isUsbDevice(deviceDescriptor, idVendor, idProduct)) {
//             return device;
//         }
//     }
// 
//     for (UsbDevice device : usbHub.getAttachedUsbDevices()) {
//         if (!device.isUsbHub()) {
//             continue;
//         }
// 
//         UsbDevice foundDevice = findUsbDevice((UsbHub) device, idVendor, idProduct);
// 
//         if (foundDevice != null) {
//             return foundDevice;
//         }
//     }
// 
//     return null;
// }
// 
// Path: usbtools/src/main/java/io/trygvis/usb/tools/UsbCliUtil.java
// public static void listDevices(UsbHub hub, short idVendor, short idProduct) {
//     listDevices("0", hub, idVendor, idProduct);
// }


// Path: usbtools/src/main/java/io/trygvis/usb/tools/ztex/MemTest.java
import static java.util.Arrays.asList;
import static javax.usb.extra.ExtraUsbUtil.findUsbDevice;
import static io.trygvis.usb.tools.UsbCliUtil.listDevices;
import javax.usb.*;
import java.util.*;

package io.trygvis.usb.tools.ztex;



public class MemTest {
    public static final short idVendor = (short)0x221a;
    public static final short idProduct = (short)0x0100;

    public static void main(String[] a) throws UsbException {
        UsbServices usbServices = UsbHostManager.getUsbServices();
        UsbHub hub = usbServices.getRootUsbHub();

        System.out.println("MemTest");

        List<String> args = new ArrayList<String>(asList(a));
        Iterator<String> it = args.iterator();
        while (it.hasNext()) {
            String arg = it.next();
            if (arg.equals("--list")) {
                listDevices(hub, idVendor, idProduct);
                break;
            } else {
                UsbDevice usbDevice = findUsbDevice(hub, idVendor, idProduct);