### Question:
TextAndPosition { public List<Integer> match(String toMatch) { toMatch = toMatch.toLowerCase(); ArrayList<Integer> result= new ArrayList<>(); if (toMatch.length() == 0) return result; int found = 0; while ((found = content.indexOf(toMatch, found)) != -1 ) { int actualPos = convertIndexToPos(found); result.add(actualPos); found++; } return result; } private  TextAndPosition(int startPos, String content, List<Integer> limits); List<Integer> match(String toMatch); static Builder builder(int startPos);  }### Answer:
@Test public void testMatchFirst() { List<Integer> res = textAndPosition.match("bc"); assertEquals(Arrays.asList(10), res); }
@Test public void testMatchSecondA() { List<Integer> res = textAndPosition.match("f"); assertEquals(Arrays.asList(11), res); }
@Test public void testMatchSecondB() { List<Integer> res = textAndPosition.match("fg"); assertEquals(Arrays.asList(11), res); }
@Test public void testMatchSecondC() { List<Integer> res = textAndPosition.match("g"); assertEquals(Arrays.asList(11), res); }
@Test public void testMatchLastA() { List<Integer> res = textAndPosition.match("hi"); assertEquals(Arrays.asList(12), res); }
@Test public void testMatchLastB() { List<Integer> res = textAndPosition.match("h"); assertEquals(Arrays.asList(12), res); }
@Test public void testMatchLastC() { List<Integer> res = textAndPosition.match("i"); assertEquals(Arrays.asList(12), res); }
@Test public void testMatchOverlap() { List<Integer> res = textAndPosition.match("ghi"); assertEquals(Arrays.asList(11), res); }
@Test public void testMatchOverlapA() { List<Integer> res = textAndPosition.match("efghi"); assertEquals(Arrays.asList(10), res); }
@Test public void testMatchOverlapAll() { List<Integer> res = textAndPosition.match("abcdefghi"); assertEquals(Arrays.asList(10), res); }