code: public static Serializable deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
      if (bytes == null) {
        return null;
      }
      try (ByteArrayInputStream b = new ByteArrayInputStream(bytes)) {
        try (ObjectInputStream o = new ObjectInputStream(b)) {
          return (Serializable) o.readObject();
        }
      }
    }
docs: Deserializes a byte array into an object. When the bytes are null, returns null.
  
  @param bytes the byte array to deserialize
  @return the deserialized object
  @throws IOException if the deserialization fails
  @throws ClassNotFoundException if no class found to deserialize into