@Test
public void shouldEscape() {

    assertThat(CentralCollector.escapeHostname("")).isEqualTo("");
    assertThat(CentralCollector.escapeHostname("abc")).isEqualTo("abc");
    assertThat(CentralCollector.escapeHostname("a:b:c")).isEqualTo("a:b:c");
    assertThat(CentralCollector.escapeHostname(":a:b:c:")).isEqualTo("\\:a:b:c:");
    assertThat(CentralCollector.escapeHostname("::a::b::c::"))
            .isEqualTo("\\:\\:a:\\:b:\\:c:\\:");
    assertThat(CentralCollector.escapeHostname(":::a:::b:::c:::"))
            .isEqualTo("\\:\\:\\:a:\\:\\:b:\\:\\:c:\\:\\:");
    assertThat(CentralCollector.escapeHostname("::::")).isEqualTo("\\:\\:\\:\\:");
    assertThat(CentralCollector.escapeHostname("a\\b\\c")).isEqualTo("a\\\\b\\\\c");
}