boolean (long cutoff) { long totalDiff = 0; for (int i = 0; i < myRanges.length; i += 2) { long diff = myRanges[i + 1] - myRanges[i]; if (diff < 0) return true; totalDiff += diff + 1; if (totalDiff < 0 || totalDiff > cutoff) return true; } return false; }