Integer (@NotNull Side touchSide, int equalForward, int equalBackward, @NotNull Range range1, @NotNull Range range2, int threshold) { List<? extends Line> touchLines = touchSide.select(myData1, myData2); int touchStart = touchSide.select(range2.start1, range2.start2); int shiftForward = findNextUnimportantLine(touchLines, touchStart, equalForward + 1, threshold); int shiftBackward = findPrevUnimportantLine(touchLines, touchStart - 1, equalBackward + 1, threshold); return getShift(shiftForward, shiftBackward); }