docs: public static Set<Type> getTypes(EnhancedAnnotated<?, ?> annotated) {
          // array and primitive types require special treatment
          if (annotated.getJavaClass().isArray() || annotated.getJavaClass().isPrimitive()) {
              return ImmutableSet.<Type>builder().addAll(annotated.getBaseType(), Object.class).build();
          } else {
              if (annotated.isAnnotationPresent(Typed.class)) {
                  return ImmutableSet.<Type>builder().addAll(getTypedTypes(Reflections.buildTypeMap(annotated.getTypeClosure()),
                          annotated.getJavaClass(), annotated.getAnnotation(Typed.class))).build();
              } else {
                  if (annotated.getJavaClass().isInterface()) {
                      return getLegalBeanTypes(annotated.getTypeClosure(), annotated, Object.class);
                  }
                  return getLegalBeanTypes(annotated.getTypeClosure(), annotated);
              }
          }
      }