### Question:
GenericXBeePacket extends XBeeAPIPacket { public byte[] getRFData() { if (rfData == null) return null; return Arrays.copyOf(rfData, rfData.length); } GenericXBeePacket(byte[] rfData); static GenericXBeePacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); void setRFData(byte[] rfData); byte[] getRFData(); @Override boolean isBroadcast();  }### Answer:
@Test public final void testGetRFDataNullData() { byte[] data = null; GenericXBeePacket packet = new GenericXBeePacket(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() { byte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61}; GenericXBeePacket packet = new GenericXBeePacket(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())))); }