void () { if (myDelegate.atEnd()) { myEnd = -1; } else { myAttributes = myDelegate.getTextAttributes(); do { myEnd = myDelegate.getEnd(); myDelegate.advance(); } while (!myDelegate.atEnd() && Objects.equals(myAttributes, myDelegate.getTextAttributes())); } }