question: public static String displayMap ( String mapName , Map < String , Object > map ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( mapName ) ; sb . append ( ":\n" ) ; Set < String > keys = map . keySet ( ) ; if ( keys . isEmpty ( ) ) { sb . append ( "None\n" ) ; } else { int count = 0 ; for ( String key : keys ) { sb . append ( "  [" ) ; sb . append ( ++ count ) ; sb . append ( "] " ) ; sb . append ( key ) ; sb . append ( ": " ) ; sb . append ( map . get ( key ) ) ; sb . append ( "\n" ) ; } } return sb . toString ( ) ; }
target:  Display the keys and values in a Map