Occurs for both identical and equal payloads.
To reproduce this, receive the same bytes sequence of bytes twice. A NoSuchElementException is raised from Optional somewhere in receiveSyncMessage. It seems that every message received after this occurs will be met with the same exception, new or not.
generateSyncMessage seems to exhibit the same behavior after raising the exception in receiveSyncMessage, suggesting that there might be something stateful breaking after the exception occurs the first time.