var getenv = Java.type("java.lang.System").getenv;
var uri = Java.type("java.net.URI").create;

function dockerHostOrDefault(defaultHost) {
  var dockerHost = getenv("DOCKER_HOST");
  return dockerHost ? uri(dockerHost).getHost() : defaultHost;
}

var env = Java.type("java.lang.System").getenv;
var uri = Java.type("java.net.URI").create;

function dockerHostOrDefault(defaultHost) {
  var dockerHost = env("DOCKER_HOST");
  return dockerHost ? uri(dockerHost).getHost() : defaultHost;
}

rename ENV helper to env