code: private void moveContentBreaks(int numOfBreaks, BreakIterator breakIterator, boolean followingNotPreceding) {
          if (area.getLength() == 0) {
              return;
          }
  
          breakIterator.setText(area.getText());
          if (followingNotPreceding) {
              breakIterator.following(getPosition());
          } else {
              breakIterator.preceding(getPosition());
          }
          for (int i = 1; i < numOfBreaks; i++) {
              breakIterator.next();
          }
          moveTo(breakIterator.current());
      }
docs: Helper method for reducing duplicate code
  @param numOfBreaks the number of breaks
  @param breakIterator the type of iterator to use
  @param followingNotPreceding if true, use {@link BreakIterator#following(int)}.
  Otherwise, use {@link BreakIterator#preceding(int)}.