### Question:
ButtplugWSClient extends ButtplugClient { public void connect(URI url) throws Exception { connect(url, false); } ButtplugWSClient(String clientName); void connect(URI url); void connect(String url, boolean trustAll); void connect(URI url, boolean trustAll); @Override void onConnect(); @Override void disconnect(); @Override void onServerInfo(ServerInfo msg); public ButtplugEventHandler connected; public ButtplugEventHandler disconnected; }### Answer:
@Ignore @Test public void TestConnect() throws Exception { ButtplugWSClient client = new ButtplugWSClient("Java Test"); client.connect(new URI("wss: Assert.assertTrue(client.startScanning()); Thread.sleep(5000); client.requestDeviceList(); for (DeviceMessageInfo deviceInfo : client.getDevices().values()) { if (deviceInfo.deviceMessages.keySet().contains(SingleMotorVibrateCmd.class.getSimpleName())) { ButtplugMessage msg = client.sendDeviceMessage(deviceInfo.deviceIndex, new SingleMotorVibrateCmd(deviceInfo.deviceIndex, 0.5, client .getNextMsgId())).get(); Assert.assertEquals(Ok.class, msg.getClass()); } } Thread.sleep(1000); Assert.assertTrue(client.sendMessageExpectOk(new StopAllDevices(client.getNextMsgId()))); client.disconnect(); }