void () { final PatchHunk patchHunk = new PatchHunk(1, 8, 1, 8); final PatchLine line = new PatchLine(PatchLine.Type.ADD, "5"); line.setSuppressNewLine(true); patchHunk.addLine(line); AppliedPatch result = GenericPatchApplier.apply("", Collections.singletonList(patchHunk)); Assert.assertNotNull(result); Assert.assertEquals(ApplyPatchStatus.SUCCESS, result.status); //this hunk would be applied as not bounded, it would be written at first, thus we will ignore no new line Assert.assertEquals("5\n", result.patchedText); }