presto-spi/src/main/java/io/prestosql/spi/block/BlockUtil.java/BlockUtil/checkValidPosition
class BlockUtil:    static void checkValidPosition(int position, int positionCount)
    {
        if (position < 0 || position >= positionCount) {
            throw new IllegalArgumentException(format("Invalid position %s in block with %s positions", position, positionCount));
        }
    }