code: protected void beanDefinitionCheck() {
          for (int i = 0; i < beanDefinitions.size(); i++) {
              for (int j = i + 1; j < beanDefinitions.size(); j++) {
                  BeanDefinition b1 = beanDefinitions.get(i);
                  BeanDefinition b2 = beanDefinitions.get(j);
  
                  // Two components' id are equal
                  if (VerifyUtils.isNotEmpty(b1.getId())
                          && VerifyUtils.isNotEmpty(b2.getId())
                          && b1.getId().equals(b2.getId())) {
                      error("Duplicated bean ID of " + b1.getClassName() + " and " + b2.getClassName());
                  }
  
                  if (b1.getClassName().equals(b2.getClassName())) {
                      // Two components' class name are equal, but one of them does not set id.
                      if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                          error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                      } else {
                          // Their id are different, save them to memo.
                          // When the component is injecting by type, throw an exception.
                          errorMemo.add(b1.getClassName());
                      }
                  }
  
                  for (String iname1 : b1.getInterfaceNames()) {
                      for (String iname2 : b2.getInterfaceNames()) {
                          if (iname1.equals(iname2)) {
                              // Two components' interface name are equal, but one of them does not set id.
                              if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                                  error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                              } else {
                                  // Their id are different, save them to memo.
                                  // When the component is injecting by type, throw an exception.
                                  errorMemo.add(iname1);
                              }
                          }
                      }
                  }
  
              }
          }
      }
docs: Bean definition conflict check