### Question:
RegularExpressionTextSearchStrategy extends AbstractTextSearchStrategy { @Override public int indexOf(String text) { return matcher.reset(text).matches() ? matcher.start() : -1; }  @Override void setSubtext(String regex); @Override int indexOf(String text);  }### Answer:
@Test public void testIndexOf() { RegularExpressionTextSearchStrategy strategy = new RegularExpressionTextSearchStrategy(); strategy.setSubtext("[a-z]"); assertEquals(0, strategy.indexOf("a")); }