First effort to fix JENKINS-23206
introducing unit tests !
simplify detection