public static String asString ( Collection < ? > collection ) { if ( collection == null ) { return NULL ; } StringBuilder builder = new StringBuilder ( ) ; builder . append ( ' ' ) ; boolean first = true ; for ( Object item : collection ) { if ( first ) { first = false ; } else { builder . append ( ' ' ) ; } builder . append ( asString ( item ) ) ; } builder . append ( ' ' ) ; return builder . toString ( ) ; }
Make a printable string from a collection using the tools here .