Test message threading and duplicate matching