I am not sure if you are still looking for an answer.
The coder as written will check the lower and upper. The reason these get checked is the following line of code:
for(long possiblePrime=min;possiblePrime <=max;possiblePrime++)
This sets and loops through the candidate prime list. It starts with the min value (set to 2 in example) and finishes with 1000 (including 1000 because of the <= test).
If you didn't want to include 2 and 1000, you could change the code to:
for(long possiblePrime=min+1;possiblePrime <max;possiblePrime++)
This would eliminate the lower bound by starting with one larger than it and the upper bound by stopping before testing it.