void () { StringSearcher searcher = new StringSearcher("xxx", true, true); IntList found = new IntArrayList(new int[]{-1}); CharSequence text = StringUtil.repeat("xxx z ", 1000000); PlatformTestUtil.startPerformanceTest("processTextOccurrences", 100, ()-> { for (int i=0; i<10000; i++) { found.removeInt(0); int startOffset = text.length() / 2 + i % 20; int endOffset = startOffset + 8; boolean success = LowLevelSearchUtil.processTexts(text, startOffset, endOffset, searcher, offset -> { found.add(offset); return true; }); assertTrue(success); assertEquals(startOffset+","+endOffset, 1, found.size()); } }).assertTiming(); }