This can be fixed by adding a helper class GitLabHelper that contains these generic methods at one place.
Fixed in https://github.com/baymac/gitlab-branch-source-plugin/pull/20