insert(HOST_B_ATTRS);
insert(HOST_B_ATTRS); // Double insert should be allowed.
assertEquals(Optional.of(HOST_B_ATTRS), read(HOST_B));
assertEquals(ImmutableSet.of(HOST_A_ATTRS, HOST_B_ATTRS), readAll());
IHostAttributes updatedA = IHostAttributes.build(
HOST_A_ATTRS.newBuilder().setAttributes(ImmutableSet.of(ATTR1, ATTR3)));
insert(updatedA);
assertEquals(Optional.of(updatedA), read(HOST_A));
assertEquals(ImmutableSet.of(updatedA, HOST_B_ATTRS), readAll());
IHostAttributes updatedMode = IHostAttributes.build(updatedA.newBuilder().setMode(DRAINED));
insert(updatedMode);
assertEquals(Optional.of(updatedMode), read(HOST_A));
assertEquals(ImmutableSet.of(updatedMode, HOST_B_ATTRS), readAll());
truncate();