@Test
public void testRetainAll() {

    NodeStore nodeStore = new NodeStore();
    NodeImpl[] nodes = new NodeImpl[] { new NodeImpl("0"), new NodeImpl("1"), new NodeImpl("2") };
    nodeStore.addAll(Arrays.asList(nodes));
    NodeImpl[] r = new NodeImpl[] { nodes[0] };
    boolean a = nodeStore.retainAll(Arrays.asList(r));
    boolean b = nodeStore.retainAll(Arrays.asList(r));
    Assert.assertTrue(a);
    Assert.assertFalse(b);
    Assert.assertEquals(nodeStore.size(), 1);
    Assert.assertTrue(nodeStore.contains(nodes[0]));
    nodeStore.retainAll(new ArrayList());
    Assert.assertTrue(nodeStore.isEmpty());
}