public static Collection < Object > getCollectionProperties ( Collection < ? > collection , String name ) throws Exception { if ( collection == null ) throw new IllegalArgumentException ( "collection, name" ) ; ArrayList < Object > list = new ArrayList < Object > ( collection . size ( ) ) ; for ( Object bean : collection ) { list . add ( getNestedProperty ( bean , name ) ) ; } return list ; }
Retrieve the list of properties that exists in a given collection