SplitHunk (@NotNull SplitHunk hunk, @NotNull List<String> contextAfter, @NotNull List<String> contextBefore) { ArrayList<BeforeAfter<List<String>>> steps = new ArrayList<>(); for (BeforeAfter<List<String>> step : hunk.getPatchSteps()) { steps.add(new BeforeAfter<>(new ArrayList<>(step.getBefore()), new ArrayList<>(step.getAfter()))); } return new SplitHunk(hunk.getStartLineBefore(), hunk.getStartLineAfter(), steps, new ArrayList<>(contextAfter), new ArrayList<>(contextBefore)); }