class RangeBoundary implements Comparable<RangeBoundary<C>> {

    @Override
    public int compareTo(RangeBoundary<C> other) {
        if (this.infinity && other.infinity) {
            return this.infinitySign - other.infinitySign;
        }
        if (this.infinity) {
            return this.isPlusInfinity() ? 1 : -1;
        }
        if (other.infinity) {
            return other.isPlusInfinity() ? -1 : 1;
        }
        return this.value.compareTo(other.value);
    }

    private  RangeBoundary(C value, boolean infinity, int infinitySign);
    public  RangeBoundary(C value);

}