@Test
  public void getConvertedPrivilegeBeanTest() {
    aceBean2 = CqActionsMapping.getConvertedPrivilegeBean(aceBean2);

    assertArrayEquals(aceBean1.getActions(), aceBean2.getActions());
    assertEquals(aceBean1.getPrivilegesString(), aceBean2.getPrivilegesString());
  }
  public boolean validatePrivileges(final AceBean tmpAclBean, AccessControlManager aclManager)
      throws InvalidJcrPrivilegeException, DoubledDefinedJcrPrivilegeException {
    String currentEntryValue = tmpAclBean.getPrivilegesString();
    String principal = tmpAclBean.getPrincipalName();

    if (!StringUtils.isNotBlank(currentEntryValue)) {
      return false;
    }
    String[] privileges = currentEntryValue.split(",");
    Set<String> privilegesSet = new HashSet<String>();

    for (int i = 0; i < privileges.length; i++) {

      // remove leading and trailing blanks from privilege name
      privileges[i] = StringUtils.strip(privileges[i]);

      if (!Validators.isValidJcrPrivilege(privileges[i], aclManager)) {
        String errorMessage =
            getBeanDescription(this.currentBeanCounter, principal)
                + ",  invalid jcr privilege: "
                + privileges[i];
        LOG.error(errorMessage);
        throw new InvalidJcrPrivilegeException(errorMessage);
      }
      if (!privilegesSet.add(privileges[i])) {
        String errorMessage =
            getBeanDescription(this.currentBeanCounter, principal)
                + ", doubled defined jcr privilege: "
                + privileges[i];
        LOG.error(errorMessage);
        throw new DoubledDefinedJcrPrivilegeException(errorMessage);
      }
    }
    tmpAclBean.setPrivilegesString(currentEntryValue);

    return true;
  }