### Question:
RX64IOPacket extends XBeeAPIPacket { public byte[] getRFData(){ if (rfData == null) return null; return Arrays.copyOf(rfData, rfData.length); } RX64IOPacket(XBee64BitAddress sourceAddress64, int rssi, int receiveOptions, byte[] rfData); static RX64IOPacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); XBee64BitAddress get64bitSourceAddress(); int getRSSI(); int getReceiveOptions(); IOSample getIOSample(); ArrayList<IOSample> getIOSamples(); void setRFData(byte[] rfData); byte[] getRFData(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testGetRFDataNullData() { XBee64BitAddress source64Addr = new XBee64BitAddress("0013A2004032D9AB"); int rssi = 75; int options = 0x84; byte[] receivedData = null; RX64IOPacket packet = new RX64IOPacket(source64Addr, rssi, options, receivedData); byte[] result = packet.getRFData(); assertThat("RF Data must be the same", result, is(equalTo(receivedData))); assertThat("RF Data must be null", result, is(nullValue(byte[].class))); }
@Test public final void testGetRFDataInvalidData() { XBee64BitAddress source64Addr = new XBee64BitAddress("0013A2004032D9AB"); int rssi = 75; int options = 0x84; byte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61}; RX64IOPacket packet = new RX64IOPacket(source64Addr, rssi, options, receivedData); byte[] result = packet.getRFData(); assertThat("RF Data must be the same", result, is(equalTo(receivedData))); assertThat("RF Data must not be the same object", result.hashCode(), is(not(equalTo(receivedData.hashCode())))); }
@Test public final void testGetRFDataValidData() { XBee64BitAddress source64Addr = new XBee64BitAddress("0013A2004032D9AB"); int rssi = 75; int options = 0x84; byte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61, (byte)0x98, 0x11, 0x32}; RX64IOPacket packet = new RX64IOPacket(source64Addr, rssi, options, receivedData); byte[] result = packet.getRFData(); assertThat("RF Data must be the same", result, is(equalTo(receivedData))); assertThat("RF Data must not be the same object", result.hashCode(), is(not(equalTo(receivedData.hashCode())))); }