public static < T > List < T > iterToList ( final Iterable < T > it ) { if ( it instanceof List ) { return ( List < T > ) it ; } if ( it == null ) { return null ; } final List < T > ar = new ArrayList < T > ( ) ; for ( final T o : it ) { ar . add ( o ) ; } return ar ; }
Converts an Iterable to a List