@Test
public void matchMulti() {

    Substitution subs = new MatchResultSubstitution("$%", r1, r2);
    assertEquals("xxaayycczz$2%2", subs.substitute("xx$1yy%1zz$2%2"));
    r1 = getMatchResult("\\.(\\w+)\\.com/(.*)", "www.saga67.com/test.htm");
    r2 = getMatchResult("a=(\\d+)&b=(\\d+)", "a=1&b=2&c=3");
    assertEquals("\\saga67, $1, $x, .saga67.com/test.htm, saga67, test.htm, $3, %1, %x, a=1&b=2, 1, 2, %3, \\",
            new MatchResultSubstitution("$%", r1, r2)
                    .substitute("\\\\$1, \\$1, $x, $0, $1, $2, $3, \\%1, %x, %0, %1, %2, %3, \\"));
}