docs: @Override
      public JsonEntityBean getEntity(String entityType, String entityId, boolean populateChildren) {
  
          // get the EntityEnum for the specified entity type
          EntityEnum entityEnum = EntityEnum.getEntityEnum(entityType);
          if (entityEnum == null) {
              throw new IllegalArgumentException(
                      String.format("Parameter entityType has an unknown value of [%s]", entityType));
          }
          // if the entity type is a group, use the group service's findGroup method
          // to locate it
          if (entityEnum.isGroup()) {
              // attempt to find the entity
              IEntityGroup entity = GroupService.findGroup(entityId);
              if (entity == null) {
                  return null;
              } else {
                  JsonEntityBean jsonBean = new JsonEntityBean(entity, entityEnum);
                  if (populateChildren) {
                      Iterator<IGroupMember> members = entity.getChildren().iterator();
                      jsonBean = populateChildren(jsonBean, members);
                  }
                  if (jsonBean.getEntityType().isGroup()
                          || EntityEnum.PERSON.equals(jsonBean.getEntityType())) {
                      IAuthorizationPrincipal principal = getPrincipalForEntity(jsonBean);
                      jsonBean.setPrincipalString(principal.getPrincipalString());
                  }
                  return jsonBean;
              }
          }
  
          // otherwise use the getGroupMember method
          else {
              IGroupMember entity = GroupService.getGroupMember(entityId, entityEnum.getClazz());
              if (entity == null || entity instanceof IEntityGroup) {
                  return null;
              }
              JsonEntityBean jsonBean = new JsonEntityBean(entity, entityEnum);
  
              // the group member interface doesn't include the entity name, so
              // we'll need to look that up manually
              jsonBean.setName(lookupEntityName(jsonBean));
              if (EntityEnum.GROUP.equals(jsonBean.getEntityType())
                      || EntityEnum.PERSON.equals(jsonBean.getEntityType())) {
                  IAuthorizationPrincipal principal = getPrincipalForEntity(jsonBean);
                  jsonBean.setPrincipalString(principal.getPrincipalString());
              }
              return jsonBean;
          }
      }