question: protected Map < String , Object > convertNamedListToMap ( NamedList < ? > args ) { Map < String , Object > argsMap = new LinkedHashMap < > ( ) ; if ( args != null ) { for ( Map . Entry < String , ? > entry : args ) { argsMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return argsMap ; }
target:  Converts a NamedList&lt;?&gt; into an ordered Map for returning as JSON.