@Test public void shouldConvertToV09() { assertThat(V09Support.convertToV09("aaa")).isEqualTo("aaa"); assertThat(V09Support.convertToV09("aaa::")).isEqualTo("aaa"); assertThat(V09Support.convertToV09("aaa::bbb")).isEqualTo("bbb"); assertThat(V09Support.convertToV09("aaa::bbb::")).isEqualTo("aaa/bbb"); assertThat(V09Support.convertToV09("aaa::bbb::ccc")).isEqualTo("ccc"); assertThat(V09Support.convertToV09("aaa::bbb::ccc::")).isEqualTo("aaa/bbb/ccc"); assertThat(V09Support.convertToV09("a")).isEqualTo("a"); assertThat(V09Support.convertToV09("a::")).isEqualTo("a"); assertThat(V09Support.convertToV09("a::b")).isEqualTo("b"); assertThat(V09Support.convertToV09("a::b::")).isEqualTo("a/b"); assertThat(V09Support.convertToV09("a::b::c")).isEqualTo("c"); assertThat(V09Support.convertToV09("a::b::c::")).isEqualTo("a/b/c"); }
static String convertToV09(String agentRollupId) { if (agentRollupId.endsWith("::")) { return agentRollupId.substring(0, agentRollupId.length() - 2).replace("::", "/"); } int index = agentRollupId.lastIndexOf("::"); if (index == -1) { return agentRollupId; } else { return agentRollupId.substring(index + 2); } }
V09Support { static String convertToV09(String agentRollupId) { if (agentRollupId.endsWith("::")) { return agentRollupId.substring(0, agentRollupId.length() - 2).replace("::", "/"); } int index = agentRollupId.lastIndexOf("::"); if (index == -1) { return agentRollupId; } else { return agentRollupId.substring(index + 2); } } }
V09Support { static String convertToV09(String agentRollupId) { if (agentRollupId.endsWith("::")) { return agentRollupId.substring(0, agentRollupId.length() - 2).replace("::", "/"); } int index = agentRollupId.lastIndexOf("::"); if (index == -1) { return agentRollupId; } else { return agentRollupId.substring(index + 2); } }  }
V09Support { static String convertToV09(String agentRollupId) { if (agentRollupId.endsWith("::")) { return agentRollupId.substring(0, agentRollupId.length() - 2).replace("::", "/"); } int index = agentRollupId.lastIndexOf("::"); if (index == -1) { return agentRollupId; } else { return agentRollupId.substring(index + 2); } }   }
V09Support { static String convertToV09(String agentRollupId) { if (agentRollupId.endsWith("::")) { return agentRollupId.substring(0, agentRollupId.length() - 2).replace("::", "/"); } int index = agentRollupId.lastIndexOf("::"); if (index == -1) { return agentRollupId; } else { return agentRollupId.substring(index + 2); } }    }