protected boolean validGroupMemberPrincipalIDs(List<GroupDocumentMember> groupMembers) {
   boolean valid = true;
   List<String> principalIds = new ArrayList<String>();
   for (GroupDocumentMember groupMember : groupMembers) {
     if (StringUtils.equals(
         groupMember.getMemberTypeCode(),
         KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode())) {
       principalIds.add(groupMember.getMemberId());
     }
   }
   if (!principalIds.isEmpty()) {
     // retrieve valid principals/principal-ids from identity service
     List<Principal> validPrincipals = getIdentityService().getPrincipals(principalIds);
     List<String> validPrincipalIds = new ArrayList<String>(validPrincipals.size());
     for (Principal principal : validPrincipals) {
       validPrincipalIds.add(principal.getPrincipalId());
     }
     // check that there are no invalid principals in the principal list, return false
     List<String> invalidPrincipalIds =
         new ArrayList<String>(CollectionUtils.subtract(principalIds, validPrincipalIds));
     // if list is not empty add error messages and return false
     if (CollectionUtils.isNotEmpty(invalidPrincipalIds)) {
       GlobalVariables.getMessageMap()
           .putError(
               "document.member.memberId",
               RiceKeyConstants.ERROR_MEMBERID_MEMBERTYPE_MISMATCH,
               invalidPrincipalIds.toArray(new String[invalidPrincipalIds.size()]));
       valid = false;
     }
   }
   return valid;
 }
 protected boolean validGroupMemberActiveDates(List<GroupDocumentMember> groupMembers) {
   boolean valid = true;
   int i = 0;
   for (GroupDocumentMember groupMember : groupMembers) {
     valid &=
         validateActiveDate(
             "document.members[" + i + "].activeToDate",
             groupMember.getActiveFromDate(),
             groupMember.getActiveToDate());
     i++;
   }
   return valid;
 }