class Acl {

  public static Principal getGroupPrincipal(String groupId) {
    checkArgument(!Strings.isNullOrEmpty(groupId), "Group ID can not be empty or null");

    // Map external group names to a separate identity source, when configured, rather
    // than assigning them to the connector's default identity source.
    // TODO(gemerson): the group name comparison here is case-sensitive; is that an issue?

    // In a connector, the Configuration class will be almost certainly be initialized,
    // but there are unit tests that don't set it up, so add a check here.
    if (Configuration.isInitialized()
        && !externalGroupsIdentitySourceId.get().isEmpty()
        && externalGroupNames.get().contains(groupId)) {
      return getGroupPrincipal(groupId, externalGroupsIdentitySourceId.get());
    }
    return new Principal().setGroupResourceName(GroupIdEncoder.encodeGroupId(groupId));
  }

  private  Acl(Builder builder);

}