public static String convertLineSeparators(String text,
                                             String newSeparator,
                                             Collection<? extends TextBlockTransferableData> itemsToUpdate) {
    if (!itemsToUpdate.isEmpty()){
      int size = 0;
      for(TextBlockTransferableData data: itemsToUpdate) {
        size += data.getOffsetCount();
      }

      int[] offsets = new int[size];
      int index = 0;
      for(TextBlockTransferableData data: itemsToUpdate) {
        index = data.getOffsets(offsets, index);
      }

      text = Strings.convertLineSeparators(text, newSeparator, offsets);

      index = 0;
      for(TextBlockTransferableData data: itemsToUpdate) {
        index = data.setOffsets(offsets, index);
      }

      return text;
    }
    else{
      return StringUtil.convertLineSeparators(text, newSeparator);
    }
  }
public static String convertLineSeparators(String text,
                                             String newSeparator,
                                             Collection<? extends TextBlockTransferableData> itemsToUpdate)