### Question:
UTF8StringValue extends StringValue { @Override public TextValue reverse() { byte[] values = bytes; if ( values.length == 0 || byteLength == 0 ) { return StringValue.EMPTY; } int i = offset, len = offset + byteLength; byte[] newValues = new byte[byteLength]; while ( i < len ) { byte b = values[i]; if ( b >= 0 ) { newValues[len - 1 - i] = b; i++; continue; } int bytesNeeded = 0; while ( b < 0 ) { bytesNeeded++; b = (byte) (b << 1); } System.arraycopy( values, i, newValues, len - i - bytesNeeded, bytesNeeded ); i += bytesNeeded; } return new UTF8StringValue( newValues, 0, newValues.length ); } UTF8StringValue( byte[] bytes, int offset, int length ); @Override void writeTo( ValueWriter<E> writer ); @Override boolean equals( Value value ); @Override int length(); @Override int computeHash(); @Override long updateHash( HashFunction hashFunction, long hash ); @Override TextValue substring( int start, int length ); @Override TextValue trim(); @Override TextValue ltrim(); @Override TextValue rtrim(); @Override TextValue plus( TextValue other ); @Override boolean startsWith( TextValue other ); @Override boolean endsWith( TextValue other ); @SuppressWarnings( "StatementWithEmptyBody" ) @Override boolean contains( TextValue other ); @Override TextValue reverse(); @Override int compareTo( TextValue other ); static int byteArrayCompare( byte[] value1, byte[] value2 ); static int byteArrayCompare( byte[] value1, int value1Offset, int value1Length,
            byte[] value2, int value2Offset, int value2Length ); byte[] bytes();  }### Answer:
@Test void shouldReverse() { for ( String string : STRINGS ) { TextValue stringValue = stringValue( string ); byte[] bytes = string.getBytes( UTF_8 ); TextValue utf8 = utf8Value( bytes ); assertSame( stringValue.reverse(), utf8.reverse() ); } }