@Test
public void setMatchResult() {

    MatchResultSubstitution subs = new MatchResultSubstitution();
    subs.setMatchResult(r1);
    assertEquals("xxaayy$2zz", subs.substitute("xx$1yy$2zz"));
    try {
        subs.setMatchResults(r1, r2);
        fail();
    } catch (IllegalArgumentException e) {
        assertThat(e, TestUtil.exception("expected 1 MatchResults"));
    }
}