### Question:
Message { public void setRetained(boolean retain) { header.retain = retain; } Message(Type type);  Message(Header header); final void write(OutputStream out); final byte[] toBytes(); void setRetained(boolean retain); boolean isRetained(); void setQos(QoS qos); QoS getQos(); void setDup(boolean dup); boolean isDup(); Type getType(); static char nextId();  }### Answer:
@Test public void retainIsSetCorrectly() { Message msg = new ConcreteMessage(Type.CONNECT); assertNotRetained(msg); msg.setRetained(true); assertRetained(msg); }