public boolean intersectsWith(PsiFragment f) {
    final int start = getStartOffset();
    final int end = getEndOffset();
    final int fStart = f.getStartOffset();
    final int fEnd = f.getEndOffset();

    return
      Comparing.equal(f.getFile(), getFile()) && ((start <= fStart && fStart <= end) || (start <= fEnd && fEnd <= end));
  }
public boolean intersectsWith(PsiFragment f)