private void writeObject(java.io.ObjectOutputStream out)
      throws IOException {
    out.defaultWriteObject();
  }
@Test
  public void javaSerdeInvalidData() throws Exception {
    int version0 = 0;
    byte[] invalidIdForVersion0 = new byte[]{0x1, 0x2, 0x3, 0x4};
    WorkerIdentity identity = new WorkerIdentity(invalidIdForVersion0, version0);
    final byte[] buffer;
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
      oos.writeObject(identity);
    }
    buffer = bos.toByteArray();
    try (ByteArrayInputStream bis = new ByteArrayInputStream(buffer);
         ObjectInputStream ois = new ObjectInputStream(bis)) {
      InvalidObjectException t = assertThrows(InvalidObjectException.class,
          ois::readObject);
      t.printStackTrace();
    }
  }