class ResourceGroupId {

    public boolean isAncestorOf(ResourceGroupId descendant)
    {
        List<String> descendantSegments = descendant.getSegments();
        if (segments.size() >= descendantSegments.size()) {
            return false;
        }
        return descendantSegments.subList(0, segments.size()).equals(segments);
    }

    public  ResourceGroupId(String name);
    public  ResourceGroupId(ResourceGroupId parent, String name);
    @JsonCreator public  ResourceGroupId(List<String> segments);

}