class CollectionTypeDefinitionBuilder implements DeclaredTypeDefinitionBuilder {

    @Override
    public boolean accept(ProcessingEnvironment processingEnv, DeclaredType type) {
        Elements elements = processingEnv.getElementUtils();
        TypeElement collectionTypeElement = elements.getTypeElement(Collection.class.getTypeName());
        TypeMirror collectionType = collectionTypeElement.asType();
        Types types = processingEnv.getTypeUtils();
        TypeMirror erasedType = types.erasure(type);
        return types.isAssignable(erasedType, collectionType);
    }

}