private static void addLinesToMsg(XmppMsg msg,ArrayList<String> lines){
  if (lines == null) {
    return;
  }
  Collections.sort(lines);
  for (  String line : lines) {
    msg.appendLine(line);
  }
}

private static void addLinesToMsg ( XmppMsg msg , ArrayList < String > lines ) { if ( lines == null ) { return ; } Collections . sort ( lines ) ; for ( String line : lines ) { msg . appendLine ( line ) ; } }
adds lines to the xmppmsg , one per line does nothing if lines is null
