question: public static List < CliFunctionResult > cleanResults ( List < ? > results ) { List < CliFunctionResult > returnResults = new ArrayList < CliFunctionResult > ( results . size ( ) ) ; for ( Object result : results ) { if ( result instanceof CliFunctionResult ) { returnResults . add ( ( CliFunctionResult ) result ) ; } } Collections . sort ( returnResults ) ; return returnResults ; }
target:  Remove elements from the list that are not instances of CliFunctionResult and then sort the results.