@Test public void should_reject_bad_patterns() { SyntheticSignaturePattern p1 = SyntheticSignaturePattern.builder().id(1L).pattern(".*foo.*(").build(); SyntheticSignaturePattern p2 = SyntheticSignaturePattern.builder().id(2L).pattern(".*bar.*").build(); when(dao.getPatterns()).thenReturn(asList(p1, p2)); assertThat(syntheticSignatureService.isSyntheticMethod("foo"), is(false)); assertThat(syntheticSignatureService.isSyntheticMethod("bar"), is(true)); verify(dao).rejectPattern(eq(p1), anyString()); }
public boolean isSyntheticMethod(String signature) { return getCompiledPattern().matcher(signature).matches(); }
SyntheticSignatureService { public boolean isSyntheticMethod(String signature) { return getCompiledPattern().matcher(signature).matches(); } }
SyntheticSignatureService { public boolean isSyntheticMethod(String signature) { return getCompiledPattern().matcher(signature).matches(); }  }
SyntheticSignatureService { public boolean isSyntheticMethod(String signature) { return getCompiledPattern().matcher(signature).matches(); }  boolean isSyntheticMethod(String signature); }
SyntheticSignatureService { public boolean isSyntheticMethod(String signature) { return getCompiledPattern().matcher(signature).matches(); }  boolean isSyntheticMethod(String signature);  }