class Range implements AutoCloseable {

    public Range intersect(Range other)
    {
        if (!this.overlaps(other)) {
            throw new IllegalArgumentException("Cannot intersect non-overlapping ranges");
        }
        Marker lowMarker = Marker.max(low, other.getLow());
        Marker highMarker = Marker.min(high, other.getHigh());
        return new Range(lowMarker, highMarker);
    }

    @JsonCreator public  Range(
            @JsonProperty("low") Marker low,
            @JsonProperty("high") Marker high);

}