class BindingConditions {

    public static <T> BindingCondition<T> anyAnnotationIsPresent(Class<? extends T> type, final Class<? extends Annotation>... annotations) {
        return new BindingCondition<T>() {
            
            @Override
            public boolean fulfilled(ClassInjector injector, Class<T> type, Map<String, Class<? extends T>[]> inheritanceTree, Annotation qualifier,
                    ClassLoader classLoader) {
                boolean exists = false;
                
                if (type != null && annotations != null && annotations.length > 0) {
                    for (Annotation annotation : type.getAnnotations()) {
                        exists = false;
                        for (Class<? extends Annotation> cmp : annotations) {
                            if (annotation.annotationType().equals(cmp)) {
                                exists = true;
                                break;
                            }
                        }
                        if (!exists) {
                            return exists;
                        }
                        exists = true;
                    }
                }
                return exists;
            }
            
        };
    }

}