BoyerMoorAlgorithm implements SearchAlgorithm { @Override public int indexOf(String source) { return indexOf(source, 0); } BoyerMoorAlgorithm(String target); @Override int indexOf(String source); @Override int indexOf(String source, int fromIndex); @Override int indexOf(String source, int fromIndex, int toIndex);  }
@Test public void indexOfWithoutStartAndEnd() throws Exception { int index = new BoyerMoorAlgorithm("abbad").indexOf("abeccaabadbabbad"); assertThat(index, equalTo(11)); }
@Test public void indexOfWithOffset() throws Exception { int index = new BoyerMoorAlgorithm("abbad").indexOf("abeabbadccaabadbabbad", 4); assertThat(index, equalTo(16)); }
@Test public void indexOfWithOffsetAndBound() throws Exception { int index = new BoyerMoorAlgorithm("abbad").indexOf("abeabbadccaabadbabbad", 4, 18); assertThat(index, equalTo(-1)); }