### Question:
UTF8StringValue extends StringValue { @Override public TextValue plus( TextValue other ) { if ( other instanceof UTF8StringValue ) { UTF8StringValue rhs = (UTF8StringValue) other; byte[] newBytes = new byte[byteLength + rhs.byteLength]; System.arraycopy( bytes, offset, newBytes, 0, byteLength ); System.arraycopy( rhs.bytes, rhs.offset, newBytes, byteLength, rhs.byteLength ); return utf8Value( newBytes ); } return Values.stringValue( stringValue() + other.stringValue() ); } 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 shouldHandleAdditionWithOffset() { byte[] bytes = "abcdefg".getBytes( UTF_8 ); UTF8StringValue a = (UTF8StringValue) utf8Value( bytes, 1, 2 ); UTF8StringValue b = (UTF8StringValue) utf8Value( bytes, 3, 3 ); assertSame( a.plus( a ), stringValue( "bcbc" ) ); assertSame( a.plus( b ), stringValue( "bcdef" ) ); assertSame( b.plus( a ), stringValue( "defbc" ) ); assertSame( b.plus( b ), stringValue( "defdef" ) ); }
@Test void shouldHandleAdditionWithOffsetAndNonAscii() { byte[] bytes = "ⲹ楡".getBytes( UTF_8 ); UTF8StringValue a = (UTF8StringValue) utf8Value( bytes, 0, 3 ); UTF8StringValue b = (UTF8StringValue) utf8Value( bytes, 3, 3 ); assertSame( a.plus( a ), stringValue( "ⲹⲹ" ) ); assertSame( a.plus( b ), stringValue( "ⲹ楡" ) ); assertSame( b.plus( a ), stringValue( "楡ⲹ") ); assertSame( b.plus( b ), stringValue( "楡楡" ) ); }