private static String concatenate(List list){
  final StringBuilder buf=new StringBuilder();
  for (  Object o : list) {
    if (!(o instanceof String)) {
      throw new RuntimeException("each element of a string list must be a string; found: " + o);
    }
    buf.append((String)o);
    buf.append("\n");
  }
  return buf.toString();
}

private static String concatenate ( List list ) { final StringBuilder buf = new StringBuilder ( ) ; for ( Object o : list ) { if ( ! ( o instanceof String ) ) { throw new RuntimeException ( "each element of a string list must be a string; found: " + o ) ; } buf . append ( ( String ) o ) ; buf . append ( "\n" ) ; } return buf . toString ( ) ; }
converts a list of strings into a multi - line string .
