void () { final PatchHunk patchHunk = new PatchHunk(1, 3, 1, 4); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "0")); patchHunk.addLine(new PatchLine(PatchLine.Type.ADD, "")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "1")); patchHunk.addLine(new PatchLine(PatchLine.Type.CONTEXT, "2")); AppliedPatch result = GenericPatchApplier.apply("0\n1\n2\n", Collections.singletonList(patchHunk)); Assert.assertNotNull(result); Assert.assertEquals(ApplyPatchStatus.SUCCESS, result.status); Assert.assertEquals("0\n\n1\n2\n", result.patchedText); }