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

        final long recordingId = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;
        final long position = buffer.getLong(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_LONG;

        builder.append(": recordingId=").append(recordingId);
        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 recordingSessionStateChange()
    {
        final String reason = "some other reason";
        internalEncodeLogHeader(buffer, 0, 10, 20, () -> 1_700_000_000L);
        buffer.putLong(LOG_HEADER_LENGTH, 30_000_000_000L, LITTLE_ENDIAN);
        buffer.putLong(LOG_HEADER_LENGTH + SIZE_OF_LONG, 40_000_000_000L, LITTLE_ENDIAN);
        final int stateChangeLength = buffer.putStringAscii(LOG_HEADER_LENGTH + 2 * SIZE_OF_LONG, "x -> y");
        buffer.putStringAscii(LOG_HEADER_LENGTH + 2 * SIZE_OF_LONG + stateChangeLength, reason);

        dissectRecordingSessionStateChange(buffer, 0, builder);

        assertEquals("[1.700000000] " + CONTEXT + ": " + RECORDING_SESSION_STATE_CHANGE.name() + " [10/20]:" +
            " recordingId=30000000000" +
            " position=40000000000" +
            " x -> y" +
            " reason=\"some other reason\"",
            builder.toString());
    }