class BindingConditions {

    public static <T> BindingCondition<T> xor(final BindingCondition<T> condition1, final BindingCondition<T> condition2) {
        return new BindingCondition<T>() {
            
            @Override
            public boolean fulfilled(ClassInjector injector, Class<T> type, Map<String, Class<? extends T>[]> inheritanceTree, Annotation qualifier,
                    ClassLoader classLoader) {
                if (condition1 != null && condition2 != null) {
                    return condition1.fulfilled(injector, type, inheritanceTree, qualifier, classLoader) != condition2.fulfilled(injector, type,
                            inheritanceTree, qualifier, classLoader);
                }
                return true;
            }
            
        };
    }

}