docs: @Override
      public Map<BeanId, Bean> getBeanToValidate(Collection<Bean> beans) throws AbortRuntimeException {
          Map<BeanId, Bean> beansToValidate = new HashMap<>();
          for (Bean bean : beans) {
              Map<BeanId, Bean> predecessors = new HashMap<>();
              // beans read from xml storage will only have their basic properties initialized...
              // ... but we also need set the direct references/predecessors for beans to validate
              Map<BeanId, Bean> beansToValidateSubset = getDirectSuccessors(bean);
              beansToValidateSubset.put(bean.getId(), bean);
              for (Bean toValidate : beansToValidateSubset.values()) {
                  predecessors.putAll(getDirectPredecessors(toValidate));
              }
  
              for (Bean predecessor : predecessors.values()) {
                  for (BeanId ref : predecessor.getReferences()) {
                      Bean b = storage.get(ref);
                      if (b == null) {
                          throw CFG301_MISSING_RUNTIME_REF(predecessor.getId());
                      }
                      ref.setBean(b);
                  }
              }
              for (Bean toValidate : beansToValidateSubset.values()) {
                  // list references of beansToValidate should now
                  // be available in predecessors.
                  for (BeanId ref : toValidate.getReferences()) {
                      Bean predecessor = predecessors.get(ref);
                      if (predecessor == null) {
                          throw new IllegalStateException("Bug in algorithm. Reference [" + ref
                                  + "] of [" + toValidate.getId()
                                  + "] should be available in predecessors.");
                      }
                      ref.setBean(predecessor);
                  }
              }
              beansToValidate.putAll(predecessors);
          }
          return beansToValidate;
      }