### Question:
Replacer { public String process(final String in) { String retVal = in; String old; do { old = retVal; retVal = from.matcher(retVal).replaceAll(to); } while (repeatUntilUnchanged && !old.equals(retVal)); return retVal; } Replacer(final String from, final String to, Modificator... modificators); String getTo(); void setTo(String to); String process(final String in); @Override String toString();  }### Answer:
@Test(timeOut = 100) public void nonRepeatingReplacerMakesSinglePass() { Replacer replacer = new Replacer("AA", "A"); assertEquals(replacer.process("AAAA"), "AA"); }
@Test(timeOut = 100) public void repeatingReplacerReducesStringCompletely() { Replacer replacer = new Replacer("AA", "A", Replacer.Modificator.REPEAT_UNTIL_UNCHANGED); assertEquals(replacer.process("AAAA"), "A"); }
@Test(timeOut = 100) public void replacerIsCaseSensitiveByDefault() { Replacer replacer = new Replacer("AA", "A"); assertEquals(replacer.process("aaaa"), "aaaa"); }
@Test(timeOut = 100) public void replacerIgnoresCaseWithModificator() { Replacer replacer = new Replacer("AA", "A", Replacer.Modificator.IGNORE_CASE); assertEquals(replacer.process("aaaa"), "AA"); }