InMemoryCachedDistributedMetaStorageBridge { public void writeFullNodeData(DistributedMetaStorageClusterNodeData fullNodeData) { assert fullNodeData.fullData != null; cache.clear(); for (DistributedMetaStorageKeyValuePair item : fullNodeData.fullData) cache.put(item.key, item.valBytes); } InMemoryCachedDistributedMetaStorageBridge(JdkMarshaller marshaller); Serializable read(String globalKey); byte[] readMarshalled(String globalKey); void iterate(
        String globalKeyPrefix,
        BiConsumer<String, ? super Serializable> cb
    ); void write(String globalKey, @Nullable byte[] valBytes); DistributedMetaStorageKeyValuePair[] localFullData(); void writeFullNodeData(DistributedMetaStorageClusterNodeData fullNodeData); DistributedMetaStorageVersion readInitialData(
        ReadOnlyMetastorage metastorage
    );  }
@Test public void testWriteFullNodeData() throws Exception { bridge.write("oldKey", marshaller.marshal("oldVal")); bridge.writeFullNodeData(new DistributedMetaStorageClusterNodeData( DistributedMetaStorageVersion.INITIAL_VERSION, new DistributedMetaStorageKeyValuePair[] { new DistributedMetaStorageKeyValuePair("newKey", marshaller.marshal("newVal")) }, DistributedMetaStorageHistoryItem.EMPTY_ARRAY, null )); assertNull(bridge.read("oldKey")); assertEquals("newVal", bridge.read("newKey")); }