test_class.file: outland-feature-server/src/test/java/outland/feature/server/groups/GroupValidatorTest.java
test_class.identifier: GroupValidatorTest
test_case.body: @Test
    public void validateRegistrationThrowingOk() {
      Group.Builder builder = Group.newBuilder();
  
      OwnerCollection.Builder oc = OwnerCollection.newBuilder()
          .addItems(Owner.newBuilder().setName("Bob").setUsername("bob"));
  
      builder.setOwners(oc)
          .setKey("key1")
          .setName("ns 1");
  
      try {
        new GroupValidator().validateRegistrationThrowing(builder.build());
      } catch (ServiceException e) {
        fail();
      }
    }
test_case.class_method_signature: GroupValidatorTest.validateRegistrationThrowingOk()
test_case.full_signature: @Test public void validateRegistrationThrowingOk()
test_case.identifier: validateRegistrationThrowingOk
test_case.invocations: newBuilder addItems newBuilder setUsername setName newBuilder setName setKey setOwners validateRegistrationThrowing build fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void validateRegistrationThrowingOk()
focal_class.file: outland-feature-server/src/main/java/outland/feature/server/groups/GroupValidator.java
focal_class.identifier: GroupValidator
focal_class.class_method_signature: GroupValidator.validateRegistrationThrowing(Group group)
focal_class.full_signature:  void validateRegistrationThrowing(Group group)
focal_class.identifier: validateRegistrationThrowing
focal_class.parameters: (Group group)
focal_class.return: void
focal_class.signature: void validateRegistrationThrowing(Group group)
focal_method.body: void validateRegistrationThrowing(Group group) throws ServiceException {
      if (group.getOwners().getItemsCount() == 0) {
        throw new ServiceException(Problem.clientProblem("no_owner_for_group",
            "A group must have at least one one owner", 422));
      }
  
      group.getOwners().getItemsList().forEach(owner -> {
        if (Strings.isNullOrEmpty(owner.getEmail()) && Strings.isNullOrEmpty(owner.getUsername())) {
          throw new ServiceException(Problem.clientProblem("incomplete_owner_for_group",
              "A group owner must have an email or a username", 422));
        }
      });
  
      if (Strings.isNullOrEmpty(group.getKey())) {
        throw new ServiceException(Problem.clientProblem("missing_key_for_group",
            "A group must have a key", 422));
      }
  
      if (Strings.isNullOrEmpty(group.getName())) {
        throw new ServiceException(Problem.clientProblem("missing_name_for_group",
            "A group must have a name", 422));
      }
    }
focal_method.class_method_signature: GroupValidator.validateRegistrationThrowing(Group group)
focal_method.full_signature:  void validateRegistrationThrowing(Group group)
focal_method.identifier: validateRegistrationThrowing
focal_method.invocations: getItemsCount getOwners clientProblem forEach getItemsList getOwners isNullOrEmpty getEmail isNullOrEmpty getUsername clientProblem isNullOrEmpty getKey clientProblem isNullOrEmpty getName clientProblem
focal_method.parameters: (Group group)
focal_method.return: void
focal_method.signature: void validateRegistrationThrowing(Group group)