class V09Support {

    static List<String> getAgentRollupIdsV09(String agentId) {
        List<String> agentRollupIds = new ArrayList<>();
        int nextFoundIndex = agentId.lastIndexOf("::", agentId.length() - 3);
        if (nextFoundIndex == -1) {
            agentRollupIds.add(agentId);
        } else {
            agentRollupIds.add(agentId.substring(agentId.lastIndexOf("::", agentId.length()) + 2));
            while (nextFoundIndex != -1) {
                agentRollupIds.add(agentId.substring(0, nextFoundIndex).replace("::", "/"));
                nextFoundIndex = agentId.lastIndexOf("::", nextFoundIndex - 1);
            }
        }
        return agentRollupIds;
    }

}