SimpleString implements EnhancedString { @Override public SimpleString replaceText(Pattern p, String rText) { Matcher m = p.matcher(value); return new SimpleString(m.replaceAll(rText)); } SimpleString(String s); @Override SimpleString replaceText(Pattern p, String rText); @Override SimpleString patternToLower(Pattern p); @Override SimpleString patternToUpper(Pattern p); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override boolean equals(Object obj); @Override String getRaw(); @NotNull @Override String toString();  }
@Test public void testReplaceText() { Assert.assertEquals(testSs.replaceText(Pattern.compile("string"), "toast"), new SimpleString("This is the toast under test")); }