class HostName {

  public String determineHostName() {
    String hostname = getHostNameFromEnv();
    if (isEmpty(hostname)) {
      hostname = execHostName();
    }
    assert !isEmpty(hostname);
    return hostname;
  }

}