void () { int[] beforeOfsetExpected = {1, 1}; int[] afterOfsetExpected = {1, 2}; final PatchHunk patchHunk = new PatchHunk(1, 4, 1, 5); patchHunk.addLine(new PatchLine(PatchLine.Type.ADD, "5")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "7")); patchHunk.addLine(new PatchLine(PatchLine.Type.REMOVE, "8")); patchHunk.addLine(new PatchLine(PatchLine.Type.ADD, "11")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "9")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "12")); List<GenericPatchApplier.SplitHunk> hunks = GenericPatchApplier.SplitHunk.read(patchHunk); assertEquals(2, hunks.size()); for (int i = 0; i < hunks.size(); i++) { assertEquals(beforeOfsetExpected[i], hunks.get(i).getStartLineBefore()); assertEquals(afterOfsetExpected[i], hunks.get(i).getStartLineAfter()); } }