docs: private static <T> Set<Type> getSessionBeanTypes(EnhancedAnnotated<T, ?> annotated, EjbDescriptor<T> ejbDescriptor) {
          ImmutableSet.Builder<Type> types = ImmutableSet.builder();
          // session beans
          Map<Class<?>, Type> typeMap = new LinkedHashMap<Class<?>, Type>();
          HierarchyDiscovery beanClassDiscovery = HierarchyDiscovery.forNormalizedType(ejbDescriptor.getBeanClass());
          for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces()) {
              // first we need to resolve the local interface
              Type resolvedLocalInterface = beanClassDiscovery.resolveType(Types.getCanonicalType(businessInterfaceDescriptor.getInterface()));
              SessionBeanHierarchyDiscovery interfaceDiscovery = new SessionBeanHierarchyDiscovery(resolvedLocalInterface);
              if (beanClassDiscovery.getTypeMap().containsKey(businessInterfaceDescriptor.getInterface())) {
                  // WELD-1675 Only add types also included in Annotated.getTypeClosure()
                  for (Entry<Class<?>, Type> entry : interfaceDiscovery.getTypeMap().entrySet()) {
                      if (annotated.getTypeClosure().contains(entry.getValue())) {
                          typeMap.put(entry.getKey(), entry.getValue());
                      }
                  }
              } else {
                  // Session bean class does not implement the business interface and @javax.ejb.Local applied to the session bean class
                  typeMap.putAll(interfaceDiscovery.getTypeMap());
              }
          }
          if (annotated.isAnnotationPresent(Typed.class)) {
              types.addAll(Beans.getTypedTypes(typeMap, annotated.getJavaClass(), annotated.getAnnotation(Typed.class)));
          } else {
              typeMap.put(Object.class, Object.class);
              types.addAll(typeMap.values());
          }
          return Beans.getLegalBeanTypes(types.build(), annotated);
      }