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;
}

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 ; }
remove elements from the list that are not instances of clifunctionresult and then sort the results .
