class RangerVirtualGroupService {

    public String getRangerVirtualGroup(Stack stack) {
        Optional<LdapView> ldapView = ldapConfigService.get(stack.getEnvironmentCrn(), stack.getName());
        String virtualGroupsEnvironmentCrn = environmentConfigProvider.getParentEnvironmentCrn(stack.getEnvironmentCrn());
        String adminGroup = ldapView.orElseThrow(() -> new CloudbreakServiceException("Ranger admin group not found."))
                .getAdminGroup();
        LOGGER.debug("Admin Group:", adminGroup);
        VirtualGroupRequest virtualGroupRequest = new VirtualGroupRequest(virtualGroupsEnvironmentCrn, adminGroup);
        return virtualGroupService.getVirtualGroup(virtualGroupRequest, UmsRight.RANGER_ADMIN.getRight());
    }

}