docs: public void build(Set<Bean<?>> beans) {
  
          if (isBuilt()) {
              throw new IllegalStateException("BeanIdentifier index is already built!");
          }
  
          if (beans.isEmpty()) {
              index = new BeanIdentifier[0];
              reverseIndex = Collections.emptyMap();
              indexHash = 0;
              indexBuilt.set(true);
              return;
          }
  
          List<BeanIdentifier> tempIndex = new ArrayList<BeanIdentifier>(beans.size());
  
          for (Bean<?> bean : beans) {
              if (bean instanceof CommonBean<?>) {
                  tempIndex.add(((CommonBean<?>) bean).getIdentifier());
              } else if (bean instanceof PassivationCapable) {
                  tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId()));
              }
          }
  
          Collections.sort(tempIndex, new Comparator<BeanIdentifier>() {
              @Override
              public int compare(BeanIdentifier o1, BeanIdentifier o2) {
                  return o1.asString().compareTo(o2.asString());
              }
          });
  
          index = tempIndex.toArray(new BeanIdentifier[tempIndex.size()]);
  
          ImmutableMap.Builder<BeanIdentifier, Integer> builder = ImmutableMap.builder();
          for (int i = 0; i < index.length; i++) {
              builder.put(index[i], i);
          }
          reverseIndex = builder.build();
  
          indexHash = Arrays.hashCode(index);
  
          if(BootstrapLogger.LOG.isDebugEnabled()) {
              BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo());
          }
          indexBuilt.set(true);
      }