code: public static SafeHtml messagesToList(final Set<String> messages) {
      final SafeHtmlBuilder sbList = new SafeHtmlBuilder();
      sbList.appendHtmlConstant("<ul>");
      for (final String message : messages) {
        sbList.appendHtmlConstant("<li>");
        sbList.appendEscaped(message);
        sbList.appendHtmlConstant("</li>");
      }
      sbList.appendHtmlConstant("</ul>");
  
      return sbList.toSafeHtml();
    }
docs: build a html list out of given message set.
  
  @param messages set of message strings
  @return safe html with massages as list