Range (int currentLine, byte... inner) { List<InnerRange> innerRanges = new ArrayList<>(); int currentInnerLine = 0; for (byte type : inner) { switch (type) { case Range.EQUAL, Range.INSERTED, Range.MODIFIED -> { innerRanges.add(new InnerRange(currentInnerLine, currentInnerLine + 1, type)); currentInnerLine++; } case Range.DELETED -> innerRanges.add(new InnerRange(currentInnerLine, currentInnerLine, type)); } } return new Range(currentLine, currentLine + currentInnerLine, 0, 1, innerRanges); }