I'm sorry, but I'm afraid you are wrong. As I said earlier it just the looks. Probably because of the unfortunate function name. Should probably be more like getChangeNumbersDownto(...)

Quoting the docs for getChangeNumbersTo(...) in https://github.com/jenkinsci/perforce-plugin/blob/15b98cb7f6824b0a1ac49be920c2834123def510/src/main/java/com/tek42/perforce/parse/Changes.java#L212

> "Returns a list of changenumbers that start with the most recent change and work back to the specified change."

The p4WorkspacePath parameter narrows the changes to specified workspace only, and the lastChange+1 is the *minimal* change that is possible to be included in the returned list. Any change valid to given workspace and greater or equal to lastChange+1 will be in the list, any smaller will not.

Then you have line 959 ("workspaceChanges.size()-1") to get the oldest change from all the changes newer than lastChange, which is the magical "next" we seek.

NB my recollection. I would consider Changes.java the best place to write a function like getNextChangeAfter(workspace, changenumber), as you suggested earlier, and it is in tek42 package.