0x04, 0x03, 'a', 'b', 'c', // entryUUID syncUUID OPTIONAL,
0x04, 0x04, 'x', 'k', 'c', 'd' // cookie syncCookie OPTIONAL,
} );
bb.flip();
SyncStateValue decorator = new SyncStateValueDecorator( codec );
SyncStateValue syncStateValue = (SyncStateValue)((SyncStateValueDecorator)decorator).decode( bb.array() );
assertEquals( SyncStateTypeEnum.PRESENT, syncStateValue.getSyncStateType() );
assertEquals( "abc", Strings.utf8ToString(syncStateValue.getEntryUUID()) );
assertEquals( "xkcd", Strings.utf8ToString(syncStateValue.getCookie()) );
// Check the encoding
try
{
ByteBuffer encoded = ((SyncStateValueDecorator)syncStateValue).encode( ByteBuffer.allocate( ((SyncStateValueDecorator)syncStateValue).computeLength() ) );