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); AppliedSomehowPatch result = GenericPatchApplier.applySomehow("7\n8\n5\n", Collections.singletonList(patchHunk)); Assert.assertTrue(result.isAppliedSomehow); Assert.assertEquals("5\n7\n8\n5\n", result.patchedText); }