question: 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 ( ) ; }
target:  Converts a list of strings into a multi-line string.