Well the patch doesnt attempt to change anything about the breakiterator logic: so your test is "valid" but testing something different.
Let me try to explain:
The bug Manuel found here is "matching term spanning the content boundary". so lets call this "truncated term". This patch fixes this so formatter doesnt have to deal with it, and there is no AIOOBE or strange checks in the formatter.
The test you write is for different behavior: it saying, if the passage itself spans the content boundary, don't present it to the formatter at all. But, this is sorta a different issue, its already handled here today by Math.min and the formatter never has to deal with it:
assert BreakIterator.DONE < 0;
current.startOffset = Math.max(bi.preceding(start+1), 0);
current.endOffset = Math.min(bi.next(), contentLength);
If we want to change the behavior for this, thats cool too, but its not really related to the bug at hand. I am not opposed to fixing it, but one problem would be someone using stuff like WholeBreakIterator, though we could "solve" it in a different way by having WholeBreakIterator take in the limit itself (I dont know if this would address your concern though).