//final ReplicationSync syncSender = new ReplicationSync(5);
sender = new PeerBuilderDHT(new PeerBuilder(new Number160(1)).ports(4001).start()).start();
//final ReplicationSync syncReceiver = new ReplicationSync(5);
receiver = new PeerBuilderDHT(new PeerBuilder(new Number160(2)).ports(4002).start()).start();
final PeerSync senderSync = new PeerSync(sender, 5);
new PeerSync(receiver, 5);
final Number160 locationKey = new Number160(100);
final Number160 domainKey = Number160.ZERO;
final Number160 contentKey = Number160.ZERO;
final String value = "Test";
HashMap<Number640, Data> map = new HashMap<Number640, Data>();
final DataMap dataMap = new DataMap(map);
map.put(new Number640(locationKey, domainKey, contentKey, Number160.ZERO), new Data("Test"));
sender.put(locationKey).data(new Data(value)).start().awaitUninterruptibly();
receiver.put(locationKey).data(new Data(value)).start().awaitUninterruptibly();
sender.peer().bootstrap().peerAddress(receiver.peerAddress()).start().awaitUninterruptibly();
FutureChannelCreator futureChannelCreator = sender.peer().connectionBean().reservation().create(0, 1);
final CountDownLatch latch = new CountDownLatch(1);
final PeerAddress receiverAddress = receiver.peerAddress();
futureChannelCreator.addListener(new BaseFutureAdapter<FutureChannelCreator>() {
@Override
public void operationComplete(final FutureChannelCreator future2) throws Exception {
if (future2.isSuccess()) {
SyncBuilder synchronizationBuilder = new SyncBuilder(senderSync, receiverAddress, 5);
synchronizationBuilder.dataMap(dataMap);
final FutureResponse futureResponse = senderSync.syncRPC().infoMessage(
receiverAddress, synchronizationBuilder, future2.channelCreator());
futureResponse.addListener(new BaseFutureAdapter<FutureResponse>() {
@Override
public void operationComplete(FutureResponse future) throws Exception {
System.err.println(future.failedReason());