I don't like it as well... But a test (SearchScrollTests line 325) makes an assertion fail in UnicodeUtil#UTF8toUTF16 and this was my attempt to make it fail consistently with the other check I added in this method. 

I can catch AssertionError in the test instead? Also the when the scroll id in test is used outside the test framework it will fail on the check I below here.