Buggy code:
@ SuppressWarnings ( "unchecked" ) public class QueryResponse extends SolrResponseBase { private NamedList < Object > _header = null ; private SolrDocumentList _results = null ; private NamedList < ArrayList > _sortvalues = null ; private NamedList < Object > _facetInfo = null ; private NamedList < Object > _debugInfo = null ; private NamedList < Object > _highlightingInfo = null ; private NamedList < Object > _spellInfo = null ; private NamedList < Object > _statsInfo = null ; private NamedList < Object > _termsInfo = null ; private NamedList < Object > _groupedInfo = null ; private GroupResponse _groupResponse = null ; private Map < String , Integer > _facetQuery = null ; private List < FacetField > _facetFields = null ; private List < FacetField > _limitingFacets = null ; private List < FacetField > _facetDates = null ; private List < RangeFacet > _facetRanges = null ; private Map < String , Map < String , List < String > > > _highlighting = null ; private SpellCheckResponse _spellResponse = null ; private TermsResponse _termsResponse = null ; private Map < String , FieldStatsInfo > _fieldStatsInfo = null ; private Map < String , Object > _debugMap = null ; private Map < String , String > _explainMap = null ; private transient final SolrServer solrServer ; public QueryResponse ( ) { } public QueryResponse ( NamedList < Object > res , SolrServer solrServer ) { } @ Override public void setResponse ( NamedList < Object > res ) { } private void extractSpellCheckInfo ( NamedList < Object > spellInfo ) { } private void extractTermsInfo ( NamedList < Object > termsInfo ) { } private void extractStatsInfo ( NamedList < Object > info ) { } private void extractDebugInfo ( NamedList < Object > debug ) { } private void extractGroupedInfo ( NamedList < Object > info ) { if ( info != null ) { _groupResponse = new GroupResponse ( ) ; int size = info . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { String fieldName = info . getName ( i ) ; Object fieldGroups = info . getVal ( i ) ; SimpleOrderedMap < Object > simpleOrderedMap = ( ( SimpleOrderedMap < Object > ) ( fieldGroups ) ) ; Object oMatches = simpleOrderedMap . get ( "matches" ) ; Object oNGroups = simpleOrderedMap . get ( "ngroups" ) ; Object oGroups = simpleOrderedMap . get ( "groups" ) ; Object queryCommand = simpleOrderedMap . get ( "doclist" ) ; if ( oMatches == null ) { continue ; } if ( oGroups != null ) { Integer iMatches = ( ( Integer ) ( oMatches ) ) ; ArrayList < Object > groupsArr = ( ( ArrayList < Object > ) ( oGroups ) ) ; GroupCommand groupedCommand ; if ( oNGroups != null ) { Integer iNGroups = ( ( Integer ) ( oNGroups ) ) ; groupedCommand = new GroupCommand ( fieldName , iMatches , iNGroups ) ; } else { groupedCommand = new GroupCommand ( fieldName , iMatches ) ; } for ( Object oGrp : groupsArr ) { SimpleOrderedMap grpMap = ( ( SimpleOrderedMap ) ( oGrp ) ) ; Object sGroupValue = grpMap . get ( "groupValue" ) ; SolrDocumentList doclist = ( ( SolrDocumentList ) ( grpMap . get ( "doclist" ) ) ) ; <START_BUG> Group group = new Group ( sGroupValue . toString ( ) , doclist ) ; <END_BUG> groupedCommand . add ( group ) ; } _groupResponse . add ( groupedCommand ) ; } else if ( queryCommand != null ) { Integer iMatches = ( ( Integer ) ( oMatches ) ) ; GroupCommand groupCommand = new GroupCommand ( fieldName , iMatches ) ; SolrDocumentList docList = ( ( SolrDocumentList ) ( queryCommand ) ) ; groupCommand . add ( new Group ( fieldName , docList ) ) ; _groupResponse . add ( groupCommand ) ; } } } } private void extractHighlightingInfo ( NamedList < Object > info ) { } private void extractFacetInfo ( NamedList < Object > info ) { } public void removeFacets ( ) { } public NamedList < Object > getHeader ( ) { } public SolrDocumentList getResults ( ) { } public NamedList < ArrayList > getSortValues ( ) { } public Map < String , Object > getDebugMap ( ) { } public Map < String , String > getExplainMap ( ) { } public Map < String , Integer > getFacetQuery ( ) { } public GroupResponse getGroupResponse ( ) { } public Map < String , Map < String , List < String > > > getHighlighting ( ) { } public SpellCheckResponse getSpellCheckResponse ( ) { } public TermsResponse getTermsResponse ( ) { } public List < FacetField > getFacetFields ( ) { } public List < FacetField > getFacetDates ( ) { } public List < RangeFacet > getFacetRanges ( ) { } public FacetField getFacetField ( String name ) { } public FacetField getFacetDate ( String name ) { } public List < FacetField > getLimitingFacets ( ) { } public < T > List < T > getBeans ( Class < T > type ) { } public Map < String , FieldStatsInfo > getFieldStatsInfo ( ) { } }

Fix:
Group group = new Group ( ( sGroupValue != null ? sGroupValue . toString ( ) : null ) , doclist ) ;