UTF8 implements WritableComparable<UTF8> { public byte[] getBytes() { return bytes; } UTF8();  UTF8(String string);  UTF8(UTF8 utf8); byte[] getBytes(); int getLength(); void set(String string); void set(UTF8 other); @Override void readFields(DataInput in); static void skip(DataInput in); @Override void write(DataOutput out); @Override int compareTo(UTF8 o); @Override String toString(); String toStringChecked(); @Override boolean equals(Object o); @Override int hashCode(); static byte[] getBytes(String string); static String fromBytes(byte[] bytes); static String readString(DataInput in); static int writeString(DataOutput out, String s);  }
@Test public void testGetBytes() throws Exception { for (int i = 0; i < 10000; i++) { String before = getTestString(); assertEquals(before, readModifiedUTF(UTF8.getBytes(before))); } }