presto-main/src/main/java/io/prestosql/operator/window/WindowPartition.java/WindowPartition/following
class WindowPartition:    private static int following(int rowPosition, int endPosition, long value)
    {
        if (value > (endPosition - rowPosition)) {
            return endPosition;
        }
        return toIntExact(rowPosition + value);
    }