/** @return new location based on current one but with different start and end. */ private LinearLocation derivedLocation(int start, int end) { LinearLocation subLoc = (LinearLocation) location.copy(); subLoc.setStart(start); subLoc.setEnd(end); return subLoc; }