private static <T extends TwitterResponse> List<T> asList(ListGenerator<T> g) throws TwitterClientException {
List<T> l = new LinkedList<T>();
long cursor = -1;
PagableResponseList p;
do {
try {
p = g.getList(cursor);
} catch (TwitterException e) {
throw new TwitterClientException(e);
}
l.addAll(p);
cursor = p.getNextCursor();
} while (p.hasNext());
return l;
}