internal static PostClass FindTopOfReplyChain(IDictionary<Int64, PostClass> posts, Int64 startStatusId)
{
if (!posts.ContainsKey(startStatusId))
throw new ArgumentException("startStatusId (" + startStatusId + ") が posts の中から見つかりませんでした。", nameof(startStatusId));
var nextPost = posts[startStatusId];
while (nextPost.InReplyToStatusId != null)
{
if (!posts.ContainsKey(nextPost.InReplyToStatusId.Value))
break;
nextPost = posts[nextPost.InReplyToStatusId.Value];
}
return nextPost;
}