public class FileDiffTest {
@Test
public void getHunks() throws IOException {
// given
FileDiff fileDiff = new FileDiff();
fileDiff.a = new RawText("apple\nbanana\ncat\n".getBytes());
fileDiff.b = new RawText("apple\nbanana\ncorn\n".getBytes());
DiffAlgorithm diffAlgorithm =
DiffAlgorithm.getAlgorithm(DiffAlgorithm.SupportedAlgorithm.HISTOGRAM);
fileDiff.editList = diffAlgorithm.diff(RawTextComparator.DEFAULT, fileDiff.a,
fileDiff.b);
// when
List<Hunk> hunks = fileDiff.getHunks();
// then
Hunk expectedHunk = new Hunk();
expectedHunk.beginA = 0;
expectedHunk.endA = 3;