@Test
public void match() throws RuleException {

    Concept c1 = mock(Concept.class);
    Concept c2 = mock(Concept.class);
    Concept c3 = mock(Concept.class);
    when(c1.getId()).thenReturn("concept1");
    when(c2.getId()).thenReturn("concept2");
    when(c3.getId()).thenReturn("concept3");
    TestBucket bucket = new TestBucket();
    bucket.add(c1);
    bucket.add(c2);
    bucket.add(c3);
    assertThat(bucket.match("concept1"), equalTo(singletonList(c1)));
    assertThat(bucket.match("c?ncept1"), equalTo(singletonList(c1)));
    assertThat(bucket.match("concept?"), equalTo(asList(c1, c2, c3)));
    assertThat(bucket.match("c*ncept1"), equalTo(singletonList(c1)));
    assertThat(bucket.match("concept*"), equalTo(asList(c1, c2, c3)));
}