public int getOffset() { return off; } };
int mark = offset; if (offset > gapStart) mark += gapEnd - gapStart; GapContentPosition pos = new GapContentPosition(mark);   int index = Collections.binarySearch(positions, pos); if (index < 0) index = -(index + 1); positions.add(index, pos);  return pos;
  public Position createPosition(final int offset) throws BadLocationException  {    return new Position()      {	int off = offset;	public int getOffset()	{	  return off;	}      };  }