class SimpleReplicatedLogEntrySerializer extends JSerializer {

    @Override
    public byte[] toBinary(Object obj) {
        checkArgument(obj instanceof SimpleReplicatedLogEntry, "Unsupported object type %s", obj.getClass());

        SimpleReplicatedLogEntry replicatedLogEntry = (SimpleReplicatedLogEntry)obj;
        final int estimatedSerializedSize = replicatedLogEntry.estimatedSerializedSize();

        final ByteArrayOutputStream bos = new ByteArrayOutputStream(estimatedSerializedSize);
        SerializationUtils.serialize(replicatedLogEntry, bos);
        final byte[] bytes = bos.toByteArray();

        LOG.debug("Estimated serialized size {}, data size {} for payload: {}. Actual serialized size: {}",
            estimatedSerializedSize, replicatedLogEntry.getData().size(), replicatedLogEntry.getData(), bytes.length);

        return bytes;
    }

    public  SimpleReplicatedLogEntrySerializer(final ExtendedActorSystem system);

}