static void dissectTruncateLogEntry(
        final ClusterEventCode eventCode,
        final MutableDirectBuffer buffer,
        final int offset,
        final StringBuilder builder)
    {
        int absoluteOffset = offset;
        absoluteOffset += dissectLogHeader(CONTEXT, eventCode, buffer, absoluteOffset, builder);

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

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

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

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

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

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

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

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

        final int memberId = buffer.getInt(absoluteOffset, LITTLE_ENDIAN);
        absoluteOffset += SIZE_OF_INT;

        builder.append(": memberId=").append(memberId);
        builder.append(" state=");
        buffer.getStringAscii(absoluteOffset, builder, LITTLE_ENDIAN);
        builder.append(" logLeadershipTermId=").append(logLeadershipTermId);
        builder.append(" leadershipTermId=").append(leadershipTermId);
        builder.append(" candidateTermId=").append(candidateTermId);
        builder.append(" commitPosition=").append(commitPosition);
        builder.append(" logPosition=").append(logPosition);
        builder.append(" appendPosition=").append(appendPosition);
        builder.append(" oldPosition=").append(oldPosition);
        builder.append(" newPosition=").append(newPosition);
    }
@Test
    void dissectTruncateLogEntry()
    {
        final int offset = 10;
        int writeIndex = offset;
        writeIndex += internalEncodeLogHeader(buffer, offset, 100, 200, () -> 5_000_000_000L);
        buffer.putLong(writeIndex, 555, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 166, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 42, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 1024, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 998, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 1024, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 1200, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putLong(writeIndex, 800, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_LONG;
        buffer.putInt(writeIndex, 123, LITTLE_ENDIAN);
        writeIndex += SIZE_OF_INT;
        buffer.putStringAscii(writeIndex, "election state", LITTLE_ENDIAN);

        ClusterEventDissector.dissectTruncateLogEntry(TRUNCATE_LOG_ENTRY, buffer, offset, builder);

        assertEquals("[5.000000000] " + CONTEXT + ": " + TRUNCATE_LOG_ENTRY.name() + " [100/200]: memberId=123 " +
            "state=election state logLeadershipTermId=555 leadershipTermId=166 candidateTermId=42 " +
            "commitPosition=1024 logPosition=998 appendPosition=1024 oldPosition=1200 newPosition=800",
            builder.toString());
    }