### Question:
ThreadDevice extends IPv6Device { @Override public void sendIPDataAsync(Inet6Address ipv6Address, int destPort, IPProtocol protocol, byte[] data) throws XBeeException { if (protocol != IPProtocol.UDP && protocol != IPProtocol.COAP) throw new IllegalArgumentException(ERROR_PROTOCOL_ILLEGAL); super.sendIPDataAsync(ipv6Address, destPort, protocol, data); } ThreadDevice(String port, int baudRate);  ThreadDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl);  ThreadDevice(String port, SerialPortParameters serialPortParameters);  ThreadDevice(IConnectionInterface connectionInterface); @Override void open(); @Override XBeeProtocol getXBeeProtocol(); boolean isConnected(); ThreadAssociationIndicationStatus getThreadAssociationIndicationStatus(); byte[] sendCoAPData(Inet6Address ipv6Address, String uri,
			HTTPMethodEnum method, byte[] data); byte[] sendCoAPData(Inet6Address ipv6Address, String uri, HTTPMethodEnum method,
			boolean applyChanges, byte[] data); void sendCoAPDataAsync(Inet6Address ipv6Address, String uri,
			HTTPMethodEnum method, byte[] data); void sendCoAPDataAsync(Inet6Address ipv6Address, String uri, HTTPMethodEnum method,
			boolean applyChanges, byte[] data); @Override void sendIPData(Inet6Address ipv6Address, int destPort,
			IPProtocol protocol, byte[] data); @Override void sendIPDataAsync(Inet6Address ipv6Address, int destPort,
			IPProtocol protocol, byte[] data);  }### Answer:
@Test public void testSendIPDataAsyncProtocolIllegalTCP() throws Exception { Inet6Address address = (Inet6Address) Inet6Address.getByName("FDB3:0001:0002:0000:0004:0005:0006:0007"); byte[] data = "Hello XBee".getBytes(); int destPort = 1234; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo(String.format("Protocol must be %s or %s.", IPProtocol.UDP.getName(), IPProtocol.COAP.getName())))); threadDevice.sendIPDataAsync(address, destPort, IPProtocol.TCP, data); }
@Test public void testSendIPDataAsyncProtocolIllegalTCPSSL() throws Exception { Inet6Address address = (Inet6Address) Inet6Address.getByName("FDB3:0001:0002:0000:0004:0005:0006:0007"); byte[] data = "Hello XBee".getBytes(); int destPort = 1234; exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo(String.format("Protocol must be %s or %s.", IPProtocol.UDP.getName(), IPProtocol.COAP.getName())))); threadDevice.sendIPDataAsync(address, destPort, IPProtocol.TCP_SSL, data); }