public static List < CollectionResult < ? > > getCollectionResults ( Result r ) { if ( r instanceof CollectionResult < ? > ) { List < CollectionResult < ? > > crs = new ArrayList <> ( 1 ) ; crs . add ( ( CollectionResult < ? > ) r ) ; return crs ; } if ( r instanceof HierarchicalResult ) { return filterResults ( ( ( HierarchicalResult ) r ) . getHierarchy ( ) , r , CollectionResult . class ) ; } return Collections . emptyList ( ) ; }
Collect all collection results from a Result