Tests and code to paginate listing threads.