public static long toScalarRange(int start, int end) {
    if (start > end || start < 0) {
      throw new IllegalArgumentException("Incorrect offsets: start="+start+"; end="+end);
    }
    return ((long)end << 32) | start;
  }
public static long toScalarRange(int start, int end)