### Question:
TX64Packet extends XBeeAPIPacket { public byte[] getRFData() { if (rfData == null) return null; return Arrays.copyOf(rfData, rfData.length); } TX64Packet(int frameID, XBee64BitAddress destAddress64, int transmitOptions, byte[] rfData); static TX64Packet createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); XBee64BitAddress get64bitDestinationAddress(); int getTransmitOptions(); void setRFData(byte[] rfData); byte[] getRFData(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testGetRFDataNullData() { int frameID = 0x65; XBee64BitAddress dest64Addr = new XBee64BitAddress("0013A2004032D9AB"); int options = 0x14; byte[] data = null; TX64Packet packet = new TX64Packet(frameID, dest64Addr, options, data); byte[] result = packet.getRFData(); 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 testGetRFDataValidData() { int frameID = 0x65; XBee64BitAddress dest64Addr = new XBee64BitAddress("0013A2004032D9AB"); int options = 0x14; byte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61}; TX64Packet packet = new TX64Packet(frameID, dest64Addr, options, data); byte[] result = packet.getRFData(); assertThat("RF Data must be the same", result, is(equalTo(data))); assertThat("RF Data must not be the same object", result.hashCode(), is(not(equalTo(data.hashCode())))); }