Providing a consistent interface for inRange function over modded values
If you really need to present the boolean parameters in your client API I would do that as follows

private boolean inRangeBothInclusive(long start, long end) {
    if (start == end) {
        return this.value == start;
    }
    else if (start &lt; end) {
        return start &lt;= this.value &amp;&amp; 
               this.value &lt;= end;
    }
    return !(end &lt;= this.value &amp;&amp;
             this.value &lt;= start);
}




public boolean inRange(long start, long end, boolean startInclusive, boolean endInclusive) {
    start = startInclusive ? start : start + 1;
    end = endInclusive ? end : end - 1;
    return inRangeBothInclusive(start, end);
}