MethodSelector { public boolean isSelected(String name, String description) { return isSelected(name, description, false); } MethodSelector();  MethodSelector(boolean isPattern); boolean isPattern(); int size(); boolean isEmpty(); void add(String method); boolean isSelected(String name, String description); boolean isSelected(String name, String description, boolean isStrict);  }
@Test public void testIsSelected() { MethodSelector selector = ClassSelector.create(target).selectByClass(DataSource.class.getName()); assertThat(selector, notNullValue()); assertThat(selector.isSelected("getConnection", "()", true), is(false)); assertThat(selector.isSelected("getConnection", "(String, String)"), is(true)); selector = ClassSelector.create(target).selectByClass(TestMethods.class.getName()); assertThat(selector.isSelected("param", "()", true), is(false)); assertThat(selector.isSelected("param", "(1, 2, 3)"), is(true)); assertThat(selector.isSelected("param", "()", true), is(false)); assertThat(selector.isSelected("param", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"), is(true)); selector = ClassSelector.create(target).selectByClass("org.apache.http.impl.client.CloseableHttpClient"); assertThat(selector.isSelected("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse;"), is(true)); assertThat(selector.isSelected("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;"), is(true)); assertThat(selector.isSelected("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;"), is(false)); selector = ClassSelector.create(target).selectByClass("org.apache.jsp.example.time_005fcomponent_005fexample_jsp"); assertThat(selector.isSelected("methodRun", "(J)V"), is(true)); selector = ClassSelector.create(target).selectByClass("org.apache.jasper.runtime.HttpJspBase"); assertThat(selector.isSelected("jspInit", "()V"), is(true)); assertThat(selector.isSelected("jspInit", "()V", true), is(false)); }