void (final String oldText, final String newText, final int startOffset, final int endOffset, final String replacement) { final GuiEditor.ReplaceInfo replaceInfo = GuiEditor.findFragmentToChange(oldText, newText); assertEquals(startOffset, replaceInfo.getStartOffset()); assertEquals(endOffset, replaceInfo.getEndOffset()); assertEquals(replacement, replaceInfo.getReplacement()); if (startOffset != -1 || endOffset != -1){ assertEquals(newText, oldText.substring(0, startOffset) + replacement + oldText.substring(endOffset)); } }