private TypeElement visitInterface(DeclaredType t) {
        if (t.getTypeArguments().isEmpty()) {
            return (TypeElement) t.asElement();
        } else {
            int count = t.getTypeArguments().size();
            if (t.asElement().toString().startsWith("java.util")) {
                return t.getTypeArguments().get(count - 1).accept(this, null);
            } else {
                return (TypeElement) t.asElement();
            }
        }
    }
{@code TypeExtractor} is a visitor implementation which extracts a concrete type from a generic {@link TypeElement}

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