ResultMessages implements Serializable, Iterable<ResultMessage> { public ResultMessages add(ResultMessage message) { if (message != null) { this.list.add(message); } else { throw new IllegalArgumentException("message must not be null"); } return this; } ResultMessages(ResultMessageType type);  ResultMessages(ResultMessageType type, ResultMessage... messages); ResultMessageType getType(); List<ResultMessage> getList(); ResultMessages add(ResultMessage message); ResultMessages add(String code); ResultMessages add(String code, Object... args); ResultMessages addAll(ResultMessage... messages); ResultMessages addAll(Collection<ResultMessage> messages); boolean isNotEmpty(); static ResultMessages success(); static ResultMessages info(); @Deprecated static ResultMessages warn(); static ResultMessages warning(); static ResultMessages error(); static ResultMessages danger(); @Override Iterator<ResultMessage> iterator(); @Override String toString(); static final String DEFAULT_MESSAGES_ATTRIBUTE_NAME; }
@Test(expected = IllegalArgumentException.class) public void testAdd02_null() { ResultMessage msg1 = ResultMessage.fromCode("foo"); ResultMessages messages = new ResultMessages((ResultMessageType) ERROR, msg1); messages.add((ResultMessage) null); }
@Test(expected = IllegalArgumentException.class) public void testAdd12_null() { ResultMessages messages = new ResultMessages((ResultMessageType) ERROR); messages.add("foo"); messages.add((String) null); }
@Test(expected = IllegalArgumentException.class) public void testAdd22_null() { ResultMessages messages = new ResultMessages((ResultMessageType) ERROR); messages.add("foo", "aa"); messages.add((String) null, "bb"); }