assertTrue(cut.picks(Bar.class));
assertFalse(cut.picks(FooBar.class));
}
public void testCustomMethodPointcuts() {
MethodPointcut picksApple = new MethodPointcut() {
public boolean picks(Method method) {
return method.equals(apple);
}
};
MethodPointcut picksApricot = new MethodPointcut() {
public boolean picks(Method method) {
return method.equals(apricot);
}
};
MethodPointcut cut = cuts.union(picksApple, picksApricot);
assertTrue(cut.picks(apple));
assertTrue(cut.picks(apricot));
assertFalse(cut.picks(banana));
}