code: private static <T> List<T> filterSelection(Class<T> clazz,
        IStructuredSelection selection) {
      List<T> list = new ArrayList<T>();
      for (Object obj : selection.toList()) {
        if (clazz.isAssignableFrom(obj.getClass())) {
          list.add((T) obj);
        }
      }
      return list;
    }
docs: Extract the list of <T> from the structured selection
  
  @param clazz the class T
  @param selection the structured selection
  @return the list of <T> it contains