@SuppressWarnings("unchecked")
    public static Set<TypeElement> getAnnotationValuesAsElements(AnnotationMirror mirror, String method) {
        Set<TypeElement> elements = new HashSet<TypeElement>();
        for (Map.Entry<? extends ExecutableElement,? extends AnnotationValue> entry : mirror.getElementValues().entrySet()) {
            if (entry.getKey().getSimpleName().toString().equals(method)) {
                List<AnnotationValue> values = ((List) entry.getValue().getValue());
                for (AnnotationValue value : values) {
                    DeclaredType type = (DeclaredType) value.getValue();
                    elements.add((TypeElement) type.asElement());
                }
            }
        }
        return elements;
    }
Various utility classes for {@link Element} and {@link AnnotationMirror} handling

@author tiwe
querydsl-apt/src/main/java/com/querydsl/apt/TypeUtils.java