### Question:
Message implements Serializable { public void putUserProperty(final String name, final String value) { if (MessageConst.STRING_HASH_SET.contains(name)) { throw new RuntimeException(String.format( "The Property<%s> is used by system, input another please", name)); } if (value == null || value.trim().isEmpty() || name == null || name.trim().isEmpty()) { throw new IllegalArgumentException( "The name or value of property can not be null or blank string!" ); } this.putProperty(name, value); } Message();  Message(String topic, byte[] body);  Message(String topic, String tags, String keys, int flag, byte[] body, boolean waitStoreMsgOK);  Message(String topic, String tags, byte[] body);  Message(String topic, String tags, String keys, byte[] body); void setKeys(String keys); void putUserProperty(final String name, final String value); String getUserProperty(final String name); String getProperty(final String name); String getTopic(); void setTopic(String topic); String getTags(); void setTags(String tags); String getKeys(); void setKeys(Collection<String> keys); int getDelayTimeLevel(); void setDelayTimeLevel(int level); boolean isWaitStoreMsgOK(); void setWaitStoreMsgOK(boolean waitStoreMsgOK); int getFlag(); void setFlag(int flag); byte[] getBody(); void setBody(byte[] body); Map<String, String> getProperties(); String getBuyerId(); void setBuyerId(String buyerId); @Override String toString();  }### Answer:
@Test(expected = RuntimeException.class) public void putUserPropertyWithRuntimeException() throws Exception { Message m = new Message(); m.putUserProperty(PROPERTY_TRACE_SWITCH, ""); }
@Test(expected = IllegalArgumentException.class) public void putUserNullValuePropertyWithException() throws Exception { Message m = new Message(); m.putUserProperty("prop1", null); }
@Test(expected = IllegalArgumentException.class) public void putUserEmptyValuePropertyWithException() throws Exception { Message m = new Message(); m.putUserProperty("prop1", " "); }
@Test(expected = IllegalArgumentException.class) public void putUserNullNamePropertyWithException() throws Exception { Message m = new Message(); m.putUserProperty(null, "val1"); }
@Test(expected = IllegalArgumentException.class) public void putUserEmptyNamePropertyWithException() throws Exception { Message m = new Message(); m.putUserProperty(" ", "val1"); }
@Test public void putUserProperty() throws Exception { Message m = new Message(); m.putUserProperty("prop1", "val1"); Assert.assertEquals("val1", m.getUserProperty("prop1")); }