### Question:
TXSMSPacket extends XBeeAPIPacket { public void setPhoneNumber(String phoneNumber) { if (phoneNumber == null) throw new NullPointerException(ERROR_PHONE_NUMBER_NULL); if (phoneNumber.length() > PHONE_NUMBER_LENGTH) throw new IllegalArgumentException(ERROR_PHONE_NUMBER_LENGTH); if (!Pattern.matches(PHONE_NUMBER_PATTERN, phoneNumber)) throw new IllegalArgumentException(ERROR_PHONE_NUMBER_INVALID); this.phoneNumber = Arrays.copyOf(phoneNumber.getBytes(), PHONE_NUMBER_LENGTH); } TXSMSPacket(int frameID, String phoneNumber, String data); static TXSMSPacket createPacket(byte[] payload); @Override boolean needsAPIFrameID(); @Override boolean isBroadcast(); void setPhoneNumber(String phoneNumber); byte[] getPhoneNumberByteArray(); String getPhoneNumber(); void setData(String data); String getData(); @Override LinkedHashMap<String, String> getAPIPacketParameters();  }### Answer:
@Test public final void testSetPhoneNumberInvalid() { String newPhoneNumber = "5aw34"; TXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data); exception.expect(IllegalArgumentException.class); exception.expectMessage(is(equalTo("Phone number invalid, only numbers and '+' prefix allowed."))); packet.setPhoneNumber(newPhoneNumber); }