@Test public void testNoMatch() throws Exception { when(declaredTypeMethod.asSignatureToken()).thenReturn(otherToken); when(superTypeMethod.asSignatureToken()).thenReturn(otherToken); when(interfaceTypeMethod.asSignatureToken()).thenReturn(otherToken); assertThat(new MethodOverrideMatcher<MethodDescription>(typeMatcher).matches(methodDescription), is(false)); verifyZeroInteractions(typeMatcher); }
public boolean matches(T target) { Set<TypeDescription> duplicates = new HashSet<TypeDescription>(); for (TypeDefinition typeDefinition : target.getDeclaringType()) { if (matches(target, typeDefinition) || matches(target, typeDefinition.getInterfaces(), duplicates)) { return true; } } return false; }
MethodOverrideMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Set<TypeDescription> duplicates = new HashSet<TypeDescription>(); for (TypeDefinition typeDefinition : target.getDeclaringType()) { if (matches(target, typeDefinition) || matches(target, typeDefinition.getInterfaces(), duplicates)) { return true; } } return false; } }
MethodOverrideMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Set<TypeDescription> duplicates = new HashSet<TypeDescription>(); for (TypeDefinition typeDefinition : target.getDeclaringType()) { if (matches(target, typeDefinition) || matches(target, typeDefinition.getInterfaces(), duplicates)) { return true; } } return false; } MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher); }
MethodOverrideMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Set<TypeDescription> duplicates = new HashSet<TypeDescription>(); for (TypeDefinition typeDefinition : target.getDeclaringType()) { if (matches(target, typeDefinition) || matches(target, typeDefinition.getInterfaces(), duplicates)) { return true; } } return false; } MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher); boolean matches(T target); @Override String toString(); }
MethodOverrideMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { Set<TypeDescription> duplicates = new HashSet<TypeDescription>(); for (TypeDefinition typeDefinition : target.getDeclaringType()) { if (matches(target, typeDefinition) || matches(target, typeDefinition.getInterfaces(), duplicates)) { return true; } } return false; } MethodOverrideMatcher(ElementMatcher<? super TypeDescription.Generic> matcher); boolean matches(T target); @Override String toString();  }