A Jenkins global pipeline library method semver_compare and an example Jenkinsfile for how to use it.
Gradle is used to run tests for the SemanticVersion class used in this library. The repository comes with Gradle wrapper, a helper script to automatically download and manage the gradle distribution. Invoke the wrapper script according to the OS platform:
UNIX/Linux
./gradlew test
Windows (untested)
gradlew.bat test
[1] https://docs.gradle.org/current/userguide/gradle_wrapper.html