code: public void withGeneratedName()
      {
          if (key.getAnnotation() != null) {
              if (key.getAnnotation() instanceof Named) {
                  as(factory -> factory.generatedNameOf(key.getTypeLiteral().getRawType(), ((Named) key.getAnnotation()).value()));
              }
              else {
                  as(factory -> factory.generatedNameOf(key.getTypeLiteral().getRawType(), key.getAnnotation().annotationType().getSimpleName()));
              }
          }
          else if (key.getAnnotationType() != null) {
              as(factory -> factory.generatedNameOf(key.getTypeLiteral().getRawType(), key.getAnnotationType().getSimpleName()));
          }
          else {
              as(factory -> factory.generatedNameOf(key.getTypeLiteral().getRawType()));
          }
      }
docs: Names the MBean according to {@link org.weakref.jmx.ObjectNames} name generator methods.