static void dissectReplicationSessionStateChange(
        final MutableDirectBuffer buffer, final int offset, final StringBuilder builder)
    {
        int absoluteOffset = offset;
        absoluteOffset += dissectLogHeader(CONTEXT, REPLICATION_SESSION_STATE_CHANGE, buffer, absoluteOffset, builder);

        final long replicationId = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;
        final long srcRecordingId = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;
        final long dstRecordingId = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;
        final long position = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;

        builder.append(": replicationId=").append(replicationId);
        builder.append(" srcRecordingId=").append(srcRecordingId);
        builder.append(" dstRecordingId=").append(dstRecordingId);
        builder.append(" position=").append(position);

        builder.append(" ");
        absoluteOffset += buffer.getStringAscii(absoluteOffset, builder);
        absoluteOffset += SIZE_OF_INT;

        builder.append(" reason=\"");
        buffer.getStringAscii(absoluteOffset, builder);
        builder.append("\"");
    }
@Test
    void replicationSessionStateChange()
    {
        final String reason = "no reason";
        internalEncodeLogHeader(buffer, 0, 10, 20, () -> 1_500_000_000L);
        buffer.putLong(LOG_HEADER_LENGTH, 10_000_000_000L, LITTLE_ENDIAN);
        buffer.putLong(LOG_HEADER_LENGTH + SIZE_OF_LONG, 20_000_000_000L, LITTLE_ENDIAN);
        buffer.putLong(LOG_HEADER_LENGTH + 2 * SIZE_OF_LONG, 30_000_000_000L, LITTLE_ENDIAN);
        buffer.putLong(LOG_HEADER_LENGTH + 3 * SIZE_OF_LONG, 40_000_000_000L, LITTLE_ENDIAN);
        final int stateChangeLength = buffer.putStringAscii(LOG_HEADER_LENGTH + 4 * SIZE_OF_LONG, "x -> y");
        buffer.putStringAscii(LOG_HEADER_LENGTH + 4 * SIZE_OF_LONG + stateChangeLength, reason);

        dissectReplicationSessionStateChange(buffer, 0, builder);

        assertEquals("[1.500000000] " + CONTEXT + ": " + REPLICATION_SESSION_STATE_CHANGE.name() + " [10/20]:" +
            " replicationId=10000000000" +
            " srcRecordingId=20000000000" +
            " dstRecordingId=30000000000" +
            " position=40000000000" +
            " x -> y" +
            " reason=\"no reason\"",
            builder.toString());
    }