docs: public boolean canAcceptChild(Class<? extends ElementBase> childClass) {
          if (!canAcceptChild()) {
              return false;
          }
  
          Cardinality cardinality = allowedChildClasses.getCardinality(getClass(), childClass);
          int max = cardinality.getMaxOccurrences();
          
          if (max == 0) {
              rejectReason = getDisplayName() + " does not accept " + childClass.getSimpleName() + " as a child.";
          } else if (max != Integer.MAX_VALUE && getChildCount(cardinality.getTargetClass()) >= max) {
              rejectReason = getDisplayName() + " cannot accept more than " + max + " of "
                      + cardinality.getTargetClass().getSimpleName() + ".";
          }
  
          return rejectReason == null;
      }