@Test
public void shouldGetAgentRollupParent() {

    assertThat(AgentRollupIds.getParent("aaa")).isNull();
    assertThat(AgentRollupIds.getParent("aaa::")).isNull();
    assertThat(AgentRollupIds.getParent("aaa::bbb")).isEqualTo("aaa::");
    assertThat(AgentRollupIds.getParent("aaa::bbb::")).isEqualTo("aaa::");
    assertThat(AgentRollupIds.getParent("aaa::bbb::ccc")).isEqualTo("aaa::bbb::");
    assertThat(AgentRollupIds.getParent("aaa::bbb::ccc::")).isEqualTo("aaa::bbb::");
    assertThat(AgentRollupIds.getParent("aaa:::")).isNull();
    assertThat(AgentRollupIds.getParent("aaa:::bbb")).isEqualTo("aaa:::");
    assertThat(AgentRollupIds.getParent("aaa:::bbb:::")).isEqualTo("aaa:::");
    assertThat(AgentRollupIds.getParent("aaa:::bbb:::ccc")).isEqualTo("aaa:::bbb:::");
    assertThat(AgentRollupIds.getParent("aaa:::bbb:::ccc:::")).isEqualTo("aaa:::bbb:::");
    assertThat(AgentRollupIds.getParent("aaa::::")).isNull();
    assertThat(AgentRollupIds.getParent("aaa::::bbb")).isEqualTo("aaa::::");
    assertThat(AgentRollupIds.getParent("aaa::::bbb::::")).isEqualTo("aaa::::");
    assertThat(AgentRollupIds.getParent("aaa::::bbb::::ccc")).isEqualTo("aaa::::bbb::::");
    assertThat(AgentRollupIds.getParent("aaa::::bbb::::ccc::::")).isEqualTo("aaa::::bbb::::");
    assertThat(AgentRollupIds.getParent("aaa:::::")).isEqualTo("aaa::");
    assertThat(AgentRollupIds.getParent("aaa:::::bbb")).isEqualTo("aaa:::::");
    assertThat(AgentRollupIds.getParent("aaa:::::bbb:::::")).isEqualTo("aaa:::::bbb::");
    assertThat(AgentRollupIds.getParent("aaa:::::bbb:::::ccc")).isEqualTo("aaa:::::bbb:::::");
    assertThat(AgentRollupIds.getParent("aaa:::::bbb:::::ccc:::::"))
            .isEqualTo("aaa:::::bbb:::::ccc::");
    assertThat(AgentRollupIds.getParent(":")).isNull();
    assertThat(AgentRollupIds.getParent("::")).isNull();
    assertThat(AgentRollupIds.getParent(":::")).isNull();
    assertThat(AgentRollupIds.getParent("::::")).isNull();
    assertThat(AgentRollupIds.getParent(":::::")).isNull();
    assertThat(AgentRollupIds.getParent("::::::")).isEqualTo(":::");
}