### Question:
PingReqMessage extends Message { @Override public void setRetained(boolean retain) { throw new UnsupportedOperationException("PINGREQ message does not support the RETAIN flag"); } PingReqMessage();  PingReqMessage(Header header); @Override void setDup(boolean dup); @Override void setQos(QoS qos); @Override void setRetained(boolean retain);  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void retainFlagIsNotAllowed() { msg.setRetained(true); }