docs: public static byte[] toByteArray(Serializable toSave) {
          try {
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              ObjectOutputStream os = new ObjectOutputStream(bos);
              os.writeObject(toSave);
              byte[] ret = bos.toByteArray();
              os.close();
              return ret;
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
  
      }