LongHash tests adapted from BytesRefHash