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