I have the following peace of code that tries to serialize/deserialize a `Throwable` 

```
public void test() throws IOException, ClassNotFoundException {
    IllegalStateException exception = new IllegalStateException("Oooops!");

    ByteBuffer seralized = serialize(exception);
    String asString = new String(seralized.array(), Charset.forName("UTF-8"));

    Throwable deserialized = deserialize(seralized);

    // false
    System.out.println(exception.equals(deserialized));
    // true
    System.out.println(exception.toString().equals(deserialized.toString()));

    seralized = serialize(deserialized);
    String toCompare = new String(seralized.array(), Charset.forName("UTF-8"));
    // true
    System.out.println(asString.equals(toCompare));
}

private Throwable deserialize(ByteBuffer seralized) throws IOException, ClassNotFoundException {
    return (Throwable) new ObjectInputStream(new GZIPInputStream(
            new ByteArrayInputStream(seralized.array()))).readObject();
}

private ByteBuffer serialize(Throwable exception) throws IOException {
    ByteArrayOutputStream causeBytesOut = new ByteArrayOutputStream();
    ObjectOutputStream causeOut = new ObjectOutputStream(
                                         new GZIPOutputStream(causeBytesOut));
    causeOut.writeObject(exception);
    causeOut.close();
    return ByteBuffer.wrap(causeBytesOut.toByteArray());
}

```

Explaining the code: I am testing that my serialization/deserialization is compatible. 

The first print out (false) tells me that whatever I got after deserialization is different then what I serialized. 

The second print (true) tells that the objects are "somewhat" similar. 

I tried to dig into each object to see what is the difference, so I serialized it again and looked at the content of the byte buffer. Which looks to be the same according to the last print (true). 

Why are the initial object and the one that went though serialization/deserialization different although seem to be the same?