assert category == DI8DEVTYPE_JOYSTICK;
    private void addDevice(ArrayList list, long lpDevice,        int type, String productName, String instanceName, boolean polled) {        Controller c;        int category = GET_DIDEVICE_TYPE(type);        int subtype = GET_DIDEVICE_SUBTYPE(type);        //System.out.println("Category = "+category);        if (category == DI8DEVTYPE_MOUSE) {            c = DirectInputMouse.createMouse(lpDevice, subtype, productName,                instanceName);        } else if (category == DI8DEVTYPE_KEYBOARD) {            c = DirectInputKeyboard.createKeyboard(lpDevice, subtype,                productName, instanceName);        } else {            assert category == DI8DEVTYPE_JOYSTICK;            c = DirectInputDevice.createDevice(lpDevice, subtype, productName,                instanceName,polled);        }        if (c != null) {            list.add(c);        }    }