public Optional<E> create(Annotation annotation) {
    Class<?> type = annotation.annotationType();
    if (type.isAnnotationPresent(annotationType)) {
      T classAnnotation = type.getAnnotation(annotationType);
      Element element = Elements.element(classElement).from(classAnnotation).result();
      Class<E> typeToCreate = element.getValue();
      return create(annotation, typeToCreate);
    }
    return Optional.empty();
  }
public Optional < E > create ( Annotation annotation ) { Class < ? > type = annotation . annotationType ( ) ; if ( type . isAnnotationPresent ( annotationType ) ) { T classAnnotation = type . getAnnotation ( annotationType ) ; Element element = Elements . element ( classElement ) . from ( classAnnotation ) . result ( ) ; Class < E > typeToCreate = element . getValue ( ) ; return create ( annotation , typeToCreate ) ; } return Optional . empty ( ) ; }
Tries to create the component based on the given annotation.
<p>
If the annotation type <code>T</code> is present in the given annotation,
then the implementation defined will be instantiated.

@param annotation the annotation to check if the component can be created.
@return the created component if the annotation is not annotated with the required annotation.