Base.alwaysThrow to create arbitrary function which always throws given exception
Strings.substring(int, int) is more forgiving. Accepts indexes out of bounds, and endIndex less than beginIndex