@Test
public void testSetRemove() {

    AttributeKey<Integer> key = AttributeKey.valueOf("key");
    Attribute<Integer> attr = map.attr(key);
    attr.set(1);
    assertSame(1, attr.getAndRemove());
    Attribute<Integer> attr2 = map.attr(key);
    attr2.set(2);
    assertSame(2, attr2.get());
    assertNotSame(attr, attr2);
}