code: @SuppressWarnings("unchecked")
  	public static <T> Paging<T> flattenPaging(Collection<?> collectionOfPaging, PageCriteria pageCriteria,
  	Comparator<T> sorter, BooleanExpression<T> filter)
  	{
  		if (collectionOfPaging == null || collectionOfPaging.isEmpty())
  			return null;
  
  		Paging<T> pagingResults = null;
  
  		if (sorter != null)
  		{
  			// Create tree set based paging
  			TreeSet<T> treeSet = new TreeSet<T>(sorter);
  			pagingResults = new PagingCollection<T>(treeSet, pageCriteria);
  		}
  
  		// Add all to an aggregated collection
  		Paging<T> paging = null;
  		for (Object item : collectionOfPaging)
  		{
  			if (item instanceof Paging)
  			{
  				paging = (Paging<T>) item;
  
  				if (pagingResults != null)
  					addAll(pagingResults, paging, filter);
  				else
  					pagingResults = paging;
  			}
  			else if (item != null)
  			{
  				// initialize paging results if needed
  				if (pagingResults == null)
  				{
  					if (sorter != null)
  					{
  						// Create tree set based paging
  						TreeSet<T> treeSet = new TreeSet<T>(sorter);
  						pagingResults = new PagingCollection<T>(treeSet, pageCriteria);
  					}
  					else
  						pagingResults = new PagingCollection<T>(new ArrayList<T>(), pageCriteria);
  
  				}
  
  				pagingResults.add((T) item);
  			}
  		}
  
  		return pagingResults;
  	}
docs: Aggregates multiple collections into a single paging collection
  
  @param collectionOfPaging
  the collection paging that need to be flatten
  @param sorter
  optional comparable for sorting
  @param filter
  optional filter, if filter.
  @param pageCriteria
  the page criteria
  @param <T>
  the collection page object type
  @return the flatten collections into a single collection