MeshImpl implements Mesh { public String getHostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0) { return System.getenv("COMPUTERNAME"); } else { if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0) { return System.getenv("HOSTNAME"); } } } return null; } MeshImpl(MeshOptions options);  MeshImpl(MeshOptions options, MeshComponent.Builder builder); @Override Vertx getVertx(); @Override io.vertx.reactivex.core.Vertx getRxVertx(); @Override Mesh run(); @Override Mesh run(boolean block); void invokeUpdateCheck(); String getHostname(); @Override void dontExit(); @Override void setCustomLoader(MeshCustomLoader<Vertx> verticleLoader); @Override MeshOptions getOptions(); @Override void shutdown(); @Override MeshStatus getStatus(); @Override Mesh setStatus(MeshStatus status); @Override Completable deployPlugin(Class<?> clazz, String id); @Override Set<String> pluginIds(); @Override T internal(); @Override void setMeshInternal(T meshInternal);  }
@Test public void testHostname() throws Exception { MeshImpl mesh = new MeshImpl(options()); assertNotNull(mesh.getHostname()); }