code: protected void checkNameUniqueness(String beanName, List<String> aliases, Element beanElement) {
      String foundName = null;
  
      if (StringUtils.hasText(beanName) && this.usedNames.contains(beanName)) foundName = beanName;
  
      if (foundName == null) foundName = (String) CollectionUtils.findFirstMatch(this.usedNames, aliases);
  
      if (foundName != null) error("Bean name '" + foundName + "' is already used in this file", beanElement);
  
      this.usedNames.add(beanName);
      this.usedNames.addAll(aliases);
    }
docs: Validate that the specified bean name and aliases have not been used
  already.
  
  @param beanName a {@link java.lang.String} object.
  @param aliases a {@link java.util.List} object.
  @param beanElement a {@link org.w3c.dom.Element} object.