static List<EntryAndPagePair[]> GroupByAuthor(List<EntryAndPagePair> entries)
{
var result = new List<EntryAndPagePair[]>();
var noAuthorDistinguisher = 0;
var authorGroupings = entries
.GroupBy(entry => !string.IsNullOrEmpty(entry.Authors) ? entry.Authors : "_" + (++noAuthorDistinguisher).ToString())
.OrderBy(g => g.Key, StringComparer.OrdinalIgnoreCase);
foreach (var authorGroup in authorGroupings)
{
result.Add(authorGroup.ToArray());
}
return result;
}