code: public static void validateMergedXML(ModuleInitData mid)
                      throws EJBConfigurationException
      {
          if (!validationEnabled()) {
              return;
          }
  
          EJBJar mergedEJBJar = mid.getMergedEJBJar();
          if (mergedEJBJar == null) { // managed beans only
              return;
          }
  
          List<String> errors = new ArrayList<String>();
  
          List<EnterpriseBean> mergedBeans = mergedEJBJar.getEnterpriseBeans();
          if (mergedBeans == null)
          {
              errors.add(MERGE + "contains no EJBs.");
              logErrors(mid.ivJ2EEName, errors);
              return;
          }
  
          TreeSet<String> mergedNames = new TreeSet<String>();
          for (EnterpriseBean mergedBean : mergedBeans) {
              mergedNames.add(mergedBean.getName());
          }
  
          for (BeanInitData bid : mid.ivBeans) {
              mergedNames.remove(bid.ivName);
          }
  
          if (!mergedNames.isEmpty()) {
              errors.add(MERGE + "contains extra EJBs named " + mergedNames);
          }
  
          logErrors(mid.ivJ2EEName, errors);
      }
docs: d680497.1