If your method is set up like the one from the shared code, the start and end frames are the times it will search between to find the closest unassigned points. The reason for this is that the List in the method, ptsInInterval, will return the timePoints between the start and end frames that you pass in.
List<TimePoint> ptsInInterval = segment.getTimePointsWithinInterval(startFrame, endFrame);
It then searches through those points as signified here:
for (TimePoint pt : ptsInInterval) {