/** * Match all methods that <i>both</i> of the given MethodMatchers match. * @param mm1 the first MethodMatcher * @param mm2 the second MethodMatcher * @return a distinct MethodMatcher that matches all methods that both * of the given MethodMatchers match */ public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) { return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ? new IntersectionIntroductionAwareMethodMatcher(mm1, mm2) : new IntersectionMethodMatcher(mm1, mm2)); }
/** * Match all methods that <i>both</i> of the given MethodMatchers match. * @param mm1 the first MethodMatcher * @param mm2 the second MethodMatcher * @return a distinct MethodMatcher that matches all methods that both * of the given MethodMatchers match */ public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) { return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ? new IntersectionIntroductionAwareMethodMatcher(mm1, mm2) : new IntersectionMethodMatcher(mm1, mm2)); }