void (FindManager findManager, FindModel findModel, String text, String ext) { findModel.setForward(true); LightVirtualFile file = new LightVirtualFile("A."+ext, text); FindResult findResult = findManager.findString(text, 0, findModel, file); Assert.assertTrue(findResult.isStringFound()); int previousOffset = findResult.getStartOffset(); findResult = findManager.findString(text, findResult.getEndOffset(), findModel, file); Assert.assertTrue(findResult.isStringFound()); Assert.assertTrue(findResult.getStartOffset() > previousOffset); previousOffset = findResult.getStartOffset(); findResult = findManager.findString(text, findResult.getEndOffset(), findModel, file); Assert.assertTrue(findResult.isStringFound()); Assert.assertTrue(findResult.getStartOffset() > previousOffset); findModel.setForward(false); findResult = findManager.findString(text, text.length(), findModel, file); Assert.assertTrue(findResult.isStringFound()); previousOffset = findResult.getStartOffset(); findResult = findManager.findString(text, previousOffset, findModel, file); Assert.assertTrue(findResult.isStringFound()); Assert.assertTrue(previousOffset > findResult.getStartOffset()); previousOffset = findResult.getStartOffset(); findResult = findManager.findString(text, previousOffset, findModel, file); Assert.assertTrue(findResult.isStringFound()); Assert.assertTrue(previousOffset > findResult.getStartOffset()); }