### Question:
CoAPTxRequestPacket extends XBeeAPIPacket { public byte[] getPayload() { if (payload == null) return null; return Arrays.copyOf(payload, payload.length); } CoAPTxRequestPacket(int frameID, int transmitOptions, HTTPMethodEnum method,
			Inet6Address destAddress, String uri, byte[] payload); static CoAPTxRequestPacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); void setTransmitOptions(int transmitOptions); int getTransmitOptions(); void setMethod(HTTPMethodEnum method); HTTPMethodEnum getMethod(); void setDestAddress(Inet6Address destAddress); Inet6Address getDestAddress(); void setURI(String uri); String getURI(); void setPayload(byte[] payload); byte[] getPayload(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testGetDataNullData() { byte[] data = null; CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); byte[] result = packet.getPayload(); assertThat("RF data must be the same", result, is(equalTo(data))); assertThat("RF data must be null", result, is(nullValue(byte[].class))); }
@Test public final void testGetDataValidData() { CoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data); byte[] result = packet.getPayload(); assertThat("Data must be the same", result, is(equalTo(data))); assertThat("Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode())))); }