}
public void testMatchIn(Pattern pattern, String incoming, String expected) {
Rewrite rewrite = pattern.matchIncoming(incoming);
assertTrue(rewrite.isMatch(), incoming);
assertEquals(rewrite.rewrite(), expected);
}
public void testMatchOut(Pattern pattern, String incoming, String expected) {
Rewrite rewrite = pattern.matchOutgoing(incoming);
assertTrue(rewrite.isMatch(), incoming);