public static String collectAndFormat ( ) { Map < String , Object > infos = collect ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Diagnostics {\n" ) ; int count = 0 ; for ( Map . Entry < String , Object > info : infos . entrySet ( ) ) { if ( count ++ > 0 ) { sb . append ( ",\n" ) ; } sb . append ( " " ) . append ( info . getKey ( ) ) . append ( "=" ) . append ( info . getValue ( ) ) ; } sb . append ( "\n}" ) ; return sb . toString ( ) ; }
Collects all available infos and formats it in a better readable way .