public NamedList<Object> toNamedList(){
  final SimpleOrderedMap<Object> result=new SimpleOrderedMap<>();
  for (Iterator<String> it=getParameterNamesIterator(); it.hasNext(); ) {
    final String name=it.next();
    final String[] values=getParams(name);
    if (values.length == 1) {
      result.add(name,values[0]);
    }
 else {
      result.add(name,values);
    }
  }
  return result;
}

public NamedList < Object > toNamedList ( ) { final SimpleOrderedMap < Object > result = new SimpleOrderedMap < > ( ) ; for ( Iterator < String > it = getParameterNamesIterator ( ) ; it . hasNext ( ) ; ) { final String name = it . next ( ) ; final String [ ] values = getParams ( name ) ; if ( values . length == 1 ) { result . add ( name , values [ 0 ] ) ; } else { result . add ( name , values ) ; } } return result ; }
convert this to a namedlist
