/**
   * Construct an IEntityGroup from a Grouper WsGroup.
   *
   * @param wsGroup
   * @return the group
   */
  protected IEntityGroup createUportalGroupFromGrouperGroup(WsGroup wsGroup) {
    IEntityGroup iEntityGroup = new EntityGroupImpl(wsGroup.getName(), IPerson.class);

    // need to set the group name and description to the actual
    // display name and description
    iEntityGroup.setName(wsGroup.getDisplayName());
    iEntityGroup.setDescription(wsGroup.getDescription());
    return iEntityGroup;
  }
  private IEntityGroup convertPagsGroupToEntity(IPersonAttributesGroupDefinition group) {

    final String cacheKey = group.getName();
    Element element = entityGroupCache.get(cacheKey);

    if (element == null) {
      final IEntityGroup entityGroup = new EntityTestingGroupImpl(group.getName(), IPERSON_CLASS);
      entityGroup.setName(group.getName());
      entityGroup.setDescription(group.getDescription());
      element = new Element(cacheKey, entityGroup);
      entityGroupCache.put(element);
    }

    return (IEntityGroup) element.getObjectValue();
  }