### Question:
CoAPRxResponsePacket extends XBeeAPIPacket { public byte[] getData() { if (data == null) return null; return Arrays.copyOf(data, data.length); } CoAPRxResponsePacket(int frameID, Inet6Address destAddress, Inet6Address sourceAddress,
			int destPort, int sourcePort, IPProtocol protocol, RestFulStatusEnum restFulStatus, byte[] rfData); static CoAPRxResponsePacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); Inet6Address getDestAddress(); void setDestAddress(Inet6Address destAddress); Inet6Address getSourceAddress(); void setSourceAddress(Inet6Address sourceAddress); int getDestPort(); void setDestPort(int destPort); int getSourcePort(); void setSourcePort(int sourcePort); IPProtocol getProtocol(); void setProtocol(IPProtocol protocol); void setStatus(RestFulStatusEnum restFulStatus); RestFulStatusEnum getStatus(); void setData(byte[] rfData); byte[] getData(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testGetDataNullData() { byte[] data = null; CoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data); byte[] result = packet.getData(); assertThat("Data must be the same", result, is(equalTo(data))); assertThat("Data must be null", result, is(nullValue(byte[].class))); }
@Test public final void testGetDataValidData() { CoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data); byte[] result = packet.getData(); 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())))); }