There is no clear answer to this as "between" can be interpreted in lots of way. I'd argue that
inBetween(1, 4) should check 2, 3 but that's just me.
There are other examples like,
Random.nextInt(1,4) - does it return values 1,2,3,4; 2,3 or 2,3,4?
So most functions tend to clarify that in the documentation, for instance:
public String substring(int beginIndex, int endIndex)
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex. Examples:
"hamburger".substring(4, 8) returns "urge"
"smiles".substring(1, 5) returns "mile"
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
If you want to be precise, then use the common mathematical notation as described here:
[1, 5) means the interval 1,2,3,4 (integers) or 1 to 4.999... if we're using floats.