code: @Override
      public boolean isBoundary(int offset) {
          checkOffset(offset, fText);
  
          // the beginning index of the iterator is always a boundary position by definition
          if (offset == fText.getBeginIndex()) {
              first();       // For side effects on current position, tag values.
              return true;
          }
  
          if (offset == fText.getEndIndex()) {
              last();       // For side effects on current position, tag values.
              return true;
          }
  
          // otherwise, we can use following() on the position before the specified
          // one and return true if the position we get back is the one the user
          // specified
  
          // return following(offset - 1) == offset;
          // TODO:  check whether it is safe to revert to the simpler offset-1 code
          //         The safe rules may take care of unpaired surrogates ok.
          fText.setIndex(offset);
          previous32(fText);
          int  pos = fText.getIndex();
          boolean result = following(pos) == offset;
          return result;
      }
docs: Returns true if the specified position is a boundary position.  As a side
  effect, leaves the iterator pointing to the first boundary position at
  or after "offset".
  @param offset the offset to check.
  @return True if "offset" is a boundary position.