BindingConditions { public static <T> BindingCondition<T> qualifierIs(Class<? extends T> type, final Class<? extends Annotation> expectedQualifier) { return new BindingCondition<T>() { @Override public boolean fulfilled(ClassInjector injector, Class<T> type, Map<String, Class<? extends T>[]> inheritanceTree, Annotation qualifier, ClassLoader classLoader) { return qualifier != null && expectedQualifier.isAssignableFrom(qualifier.annotationType()); } }; }  @SuppressWarnings("unchecked") static BindingCondition<T> annotationIsPresent(Class<? extends T> type, Class<? extends Annotation> annotation); static BindingCondition<T> qualifierIs(Class<? extends T> type, final Class<? extends Annotation> expectedQualifier); static BindingCondition<T> isNamed(Class<? extends T> type, final CharSequence value); static BindingCondition<T> isNamedIgnoringCase(Class<? extends T> type, final CharSequence value); static BindingCondition<T> allAnnotationsArePresent(Class<? extends T> type, final Class<? extends Annotation>... annotations); static BindingCondition<T> anyAnnotationIsPresent(Class<? extends T> type, final Class<? extends Annotation>... annotations); static BindingCondition<T> and(final BindingCondition<T>... conditions); static BindingCondition<T> or(final BindingCondition<T>... conditions); static BindingCondition<T> xor(final BindingCondition<T> condition1, final BindingCondition<T> condition2);  }
@Test public void qualifierIs() { assertTrue(BindingConditions.qualifierIs(Tire.class, Drivers.class).fulfilled(null, Tire.class, null, new Drivers() { @Override public Class<? extends Annotation> annotationType() { return Drivers.class; } }, classLoader)); }
@Test public void qualifierIsNot() { assertFalse(BindingConditions.qualifierIs(Tire.class, Inject.class).fulfilled(null, Tire.class, null, new Drivers() { @Override public Class<? extends Annotation> annotationType() { return Drivers.class; } }, classLoader)); }