@Override
  public String getHostname() {
    try {
      return InetAddress.getLocalHost().getHostName();
    } catch (UnknownHostException e) {
      LOG.trace("Failed to get hostname", e);
      return  "unresolved hostname";
    }
  }
@Test
  public void getHostname_returns_hostname_of_localhost_otherwise_a_constant() {
    try {
      InetAddress localHost = InetAddress.getLocalHost();
      assertThat(underTest.getHostname()).isEqualTo(localHost.getHostName());
    } catch (UnknownHostException e) {
      // no localhost on host running the UT
      assertThat(underTest.getHostname()).isEqualTo("unresolved hostname");
    }
  }