question: @ NotNull public static < T > List < T > asList ( @ Nullable final Collection < ? > expression , @ NotNull final Class < T > elementClass ) { if ( ( expression == null ) || expression . isEmpty ( ) ) { return Collections . emptyList ( ) ; } final List < T > result = new ArrayList < T > ( ) ; for ( final Object element : expression ) { final T toAdd = as ( element , elementClass ) ; if ( toAdd != null ) { result . add ( toAdd ) ; } } return result ; }
target:  Converts collection to list of certain type