private byte[] getBytes(Object o) {
    if (o instanceof byte[]) {
      return (byte[]) o;
    }
    if (o instanceof CachedDeserializable) {
      return ((CachedDeserializable) o).getSerializedValue();
    } else {
      return EntryEventImpl.serialize(o);
    }
  }
Compare the serialized form of two objects.

Note that this does not do lexigraphic order, or really any useful order. It's only guaranteed to
return 0 if the bytes are equal, and satisfy all the transitivity and communitivity properties of
compare.
geode-core/src/main/java/org/apache/geode/internal/cache/persistence/query/mock/ByteComparator.java