ContainerName { public static ContainerName fromHostname(final String hostName) { return new ContainerName(hostName.split("\\.", 2)[0]); } ContainerName(final String name); String asString(); static ContainerName fromHostname(final String hostName); @Override int hashCode(); @Override boolean equals(final Object o); @Override String toString();  }
@Test public void testContainerNameFromHostname() { assertEquals(new ContainerName("container-123"), ContainerName.fromHostname("container-123.sub.domain.tld")); }