void () { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < 20; i++) { sb.append(i + 1).append('\n'); } final GenericPatchApplier gap = new GenericPatchApplier(sb.toString(), Collections.emptyList()); final List<String> strings = Arrays.asList("5", "6", "ins", "7"); // coincidence gap.putCutIntoTransformations(new TextRange(4, 6), new GenericPatchApplier.MyAppliedData(strings, true, true, true, GenericPatchApplier.ChangeType.REPLACE)); final TreeMap<TextRange,GenericPatchApplier.MyAppliedData> transformations = gap.getTransformations(); Assert.assertFalse(transformations.isEmpty()); Assert.assertEquals(1, transformations.size()); final Map.Entry<TextRange, GenericPatchApplier.MyAppliedData> entry = transformations.entrySet().iterator().next(); final TextRange key = entry.getKey(); Assert.assertTrue(key.getStartOffset() == 5 && key.getEndOffset() == 5); final List<String> list = entry.getValue().getList(); Assert.assertEquals(2, list.size()); Assert.assertEquals("6", list.get(0)); Assert.assertEquals("ins", list.get(1)); }