public byte[] getBytes() {
    return bytes;
  }
@Test
  void serialization() throws IOException, ClassNotFoundException {
    try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos)) {

      Utf8 originalEmpty = new Utf8();
      Utf8 originalBytes = new Utf8("originalBytes".getBytes(StandardCharsets.UTF_8));
      Utf8 originalString = new Utf8("originalString");

      oos.writeObject(originalEmpty);
      oos.writeObject(originalBytes);
      oos.writeObject(originalString);
      oos.flush();

      try (ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
          ObjectInputStream ois = new ObjectInputStream(bis)) {
        assertThat(ois.readObject(), is(originalEmpty));
        assertThat(ois.readObject(), is(originalBytes));
        assertThat(ois.readObject(), is(originalString));
      }
    }
  }