### Question:
DeviceRequestPacket extends XBeeAPIPacket { public void setRequestTarget(String target) { if (target != null && target.length() > 255) throw new IllegalArgumentException(ERROR_TARGET_ILLEGAL); this.target = target; } DeviceRequestPacket(int requestID, String target, byte[] requestData); static DeviceRequestPacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); void setRequestID(int requestID); int getRequestID(); int getTransport(); int getFlags(); void setRequestTarget(String target); String getRequestTarget(); void setRequestData(byte[] requestData); byte[] getRequestData(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testSetTargetBiggerThan255() { DeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data); target = new String(new char[256]).replace('\0', '-'); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Target lenght cannot exceed 255 bytes."))); packet.setRequestTarget(target); }