Using String's `endsWith` would be optimal, but I don't think leaving this as is would block the PR.