mapKey = BinaryValue.create("flag");
update =
new DtUpdateOperation.Builder(location)
.withOp(new MapOp().update(mapKey, new FlagOp(true)))
.build();
cluster.execute(update);
update.get();
map = fetchMap(mapBucketType, bucketName, key);
assertEquals(3, map.view().size());
assertNotNull(map.view().get(mapKey));
assertEquals(1, map.view().get(mapKey).size());
assertTrue(map.view().get(mapKey).get(0).isFlag());
RiakFlag flag = map.view().get(mapKey).get(0).getAsFlag();
assertTrue(flag.getEnabled());
mapKey = BinaryValue.create("register");
update = new DtUpdateOperation.Builder(location)
.withOp(new MapOp().update(mapKey, new RegisterOp(mapKey)))
.build();
cluster.execute(update);
update.get();
map = fetchMap(mapBucketType, bucketName, key);
assertEquals(4, map.view().size());
assertNotNull(map.view().get(mapKey));
assertEquals(1, map.view().get(mapKey).size());
RiakRegister register = map.view().get(mapKey).get(0).getAsRegister();
assertEquals(mapKey, register.getValue());
mapKey = BinaryValue.create("map");
update = new DtUpdateOperation.Builder(location)
.withOp(new MapOp().update(mapKey, new MapOp().update(mapKey, new FlagOp(false))))
.build();
cluster.execute(update);
update.get();