### Question:
FrameErrorPacket extends XBeeAPIPacket { public void setError(FrameError error) { if (error == null) throw new NullPointerException(ERROR_STATUS_NULL); this.error = error; } FrameErrorPacket(FrameError error); static FrameErrorPacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); void setError(FrameError error); FrameError getError(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testSetErrorNull() { FrameErrorPacket packet = new FrameErrorPacket(error); error = null; exception.expect(NullPointerException.class); exception.expectMessage(is(equalTo("Frame error cannot be null."))); packet.setError(error); }