@Override
    public List<UsbSerialPort> getPorts() {
        return mPorts;
    }
@Test
    public void invalidSingleInterfaceDevice() throws Exception {
        UsbDeviceConnection usbDeviceConnection = mock(UsbDeviceConnection.class);
        UsbDevice usbDevice = mock(UsbDevice.class);
        UsbInterface usbInterface = mock(UsbInterface.class);
        UsbEndpoint controlEndpoint = mock(UsbEndpoint.class);
        UsbEndpoint readEndpoint = mock(UsbEndpoint.class);
        //UsbEndpoint writeEndpoint = mock(UsbEndpoint.class);

        when(usbDeviceConnection.claimInterface(usbInterface,true)).thenReturn(true);
        when(usbDevice.getInterfaceCount()).thenReturn(1);
        when(usbDevice.getInterface(0)).thenReturn(usbInterface);
        when(usbInterface.getEndpointCount()).thenReturn(2);
        when(usbInterface.getEndpoint(0)).thenReturn(controlEndpoint);
        when(usbInterface.getEndpoint(1)).thenReturn(readEndpoint);
        //when(usbInterface.getEndpoint(2)).thenReturn(writeEndpoint);
        when(controlEndpoint.getDirection()).thenReturn(UsbConstants.USB_DIR_IN);
        when(controlEndpoint.getType()).thenReturn(UsbConstants.USB_ENDPOINT_XFER_INT);
        when(readEndpoint.getDirection()).thenReturn(UsbConstants.USB_DIR_IN);
        when(readEndpoint.getType()).thenReturn(UsbConstants.USB_ENDPOINT_XFER_BULK);
        //when(writeEndpoint.getDirection()).thenReturn(UsbConstants.USB_DIR_OUT);
        //when(writeEndpoint.getType()).thenReturn(UsbConstants.USB_ENDPOINT_XFER_BULK);

        CdcAcmSerialDriver driver = new CdcAcmSerialDriver(usbDevice);
        CdcAcmSerialDriver.CdcAcmSerialPort port = (CdcAcmSerialDriver.CdcAcmSerialPort) driver.getPorts().get(0);
        port.mConnection = usbDeviceConnection;
        port.openInt();
        assertNull(port.mWriteEndpoint);
    }