public void testPattern() {
Pattern p = Pattern.compile("?ddaaad?", "?");
Assert.assertThat(p.match("ddaaad")[1], is(""));
Assert.assertThat(p.match("ddaaadxwww")[1], is("xwww"));
Assert.assertThat(p.match("addaaadxwww")[1], is("xwww"));
Assert.assertThat(p.match("addaaadxwww")[0], is("a"));
Assert.assertThat(p.match("addaaad")[0], is("a"));
Assert.assertThat(p.match("orange"), nullValue());
p = Pattern.compile("?", "?");
Assert.assertThat(p.match("orange")[0], is("orange"));