presto-spi/src/main/java/io/prestosql/spi/type/Chars.java/Chars/trimTrailingSpaces
class Chars:    public static Slice trimTrailingSpaces(Slice slice)
    {
        requireNonNull(slice, "slice is null");
        return slice.slice(0, byteCountWithoutTrailingSpace(slice, 0, slice.length()));
    }