public TerminateDriverFlyweight tokenBuffer(
        final DirectBuffer tokenBuffer, final int tokenOffset, final int tokenLength)
    {
        buffer.putInt(offset + TOKEN_LENGTH_OFFSET, tokenLength);
        if (null != tokenBuffer && tokenLength > 0)
        {
            buffer.putBytes(offset + tokenBufferOffset(), tokenBuffer, tokenOffset, tokenLength);
        }

        return this;
    }
@Test
    void tokenBuffer()
    {
        final int offset = 24;
        final UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(128));
        buffer.setMemory(0, offset, (byte)15);
        final TerminateDriverFlyweight flyweight = new TerminateDriverFlyweight();
        flyweight.wrap(buffer, offset);

        flyweight.tokenBuffer(newBuffer(16), 4, 8);

        assertEquals(8, flyweight.tokenBufferLength());
        assertEquals(TOKEN_BUFFER_OFFSET, flyweight.tokenBufferOffset());
        assertEquals(TOKEN_BUFFER_OFFSET + 8, flyweight.length());
    }