'abbreviate' contract violations
I have added unit tests showing incorrect behaviour of StringUtils.abbreviate on short strings (between abbrevMarker.length + 1 and abbrevMarker.length * 2).
The documentation states that the offset character will always appear somewhere in the result, but when an offset is applied to a short string, it may not be.
I'm unsure what's the best approach to fixing this. Should the documentation be updated to reflect the fact that for short strings, the offset marker might not be present in the result? Should the logic be changed so that the offset marker is present, and if so, what is the most efficient way?
The failing test:
// abbreviating a shorter string allows maxWidth < 7
assertEquals("...efg", StringUtils.abbreviate("abcdefg", 5, 6));
looks like a bug indeed.