code: private void validateNotSameNameAndTypeOfDeployment(DeploymentDescription deployment) {
          for (Deployment existing : deployments) {
              if (existing.getDescription().getName().equals(deployment.getName())) {
                  if (
                      (existing.getDescription().isArchiveDeployment() && deployment.isArchiveDeployment()) ||
                          (existing.getDescription().isDescriptorDeployment() && deployment.isDescriptorDeployment())) {
                      throw new IllegalArgumentException("Can not add multiple " +
                          Archive.class.getName() + " deployments with the same name: " + deployment.getName());
                  }
              }
          }
      }
docs: Validate that a deployment of same type is not already added