AttributeMap oldStyle = null;
int textLength = text.length();
for (int runStart = 0; runStart < textLength;) {
AttributeMap currentStyle = text.characterStyleAt(runStart);
int runLimit = text.characterStyleLimit(runStart);
if (runStart >= runLimit) {
errln("Run length is not positive");
}
if (currentStyle.equals(oldStyle)) {
errln("Styles didn't merge");