public void logCatalogResize(final long oldCatalogLength, final long newCatalogLength)
    {
        final int length = SIZE_OF_LONG * 2;
        final int captureLength = captureLength(length);
        final int encodedLength = encodedLength(captureLength);
        final ManyToOneRingBuffer ringBuffer = this.ringBuffer;
        final int index = ringBuffer.tryClaim(CATALOG_RESIZE.toEventCodeId(), encodedLength);

        if (index > 0)
        {
            try
            {
                encodeCatalogResize(
                    (UnsafeBuffer)ringBuffer.buffer(),
                    index,
                    captureLength,
                    length,
                    oldCatalogLength,
                    newCatalogLength);
            }
            finally
            {
                ringBuffer.commit(index);
            }
        }
    }
@Test
    void logCatalogResize()
    {
        final int offset = ALIGNMENT * 3;
        logBuffer.putLong(CAPACITY + TAIL_POSITION_OFFSET, offset);
        final int captureLength = SIZE_OF_LONG * 2;
        final long catalogLength = 42;
        final long newCatalogLength = 142;

        logger.logCatalogResize(catalogLength, newCatalogLength);

        verifyLogHeader(logBuffer, offset, CATALOG_RESIZE.toEventCodeId(), captureLength, captureLength);
        assertEquals(catalogLength,
            logBuffer.getLong(encodedMsgOffset(offset + LOG_HEADER_LENGTH), LITTLE_ENDIAN));
        assertEquals(newCatalogLength,
            logBuffer.getLong(encodedMsgOffset(offset + LOG_HEADER_LENGTH + SIZE_OF_LONG), LITTLE_ENDIAN));
    }