public static <T> ArrayList<T> filterViews(Class<T> classToFilterBy, Iterable<?> viewList) {
		ArrayList<T> filteredViews = new ArrayList<T>();
		for (Object view : viewList) {
			if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
				filteredViews.add(classToFilterBy.cast(view));
			}
		}
		viewList = null;
		return filteredViews;
	}
public static < T > ArrayList < T > filterViews ( Class < T > classToFilterBy , Iterable < ? > viewList ) { ArrayList < T > filteredViews = new ArrayList < T > ( ) ; for ( Object view : viewList ) { if ( view != null && classToFilterBy . isAssignableFrom ( view . getClass ( ) ) ) { filteredViews . add ( classToFilterBy . cast ( view ) ) ; } } viewList = null ; return filteredViews ; }
Filters Views based on the given class type.

@param classToFilterBy the class to filter
@param viewList the Iterable to filter from
@return an ArrayList with filtered views