@Test
public void testMetadata() {

    JoinGroupRequestData.JoinGroupRequestProtocolCollection serialized = coordinator.metadata();
    assertEquals(1, serialized.size());

    JoinGroupRequestData.JoinGroupRequestProtocol defaultMetadata = serialized.iterator().next();
    assertEquals(KarelDbCoordinator.KDB_SUBPROTOCOL_V0, defaultMetadata.name());
    KarelDbIdentity state
        = KarelDbProtocol.deserializeMetadata(ByteBuffer.wrap(defaultMetadata.metadata()));
    assertEquals(LEADER_INFO, state);
}