@Test
public void testToArray() {

    NodeImpl[] nodes = new NodeImpl[] { new NodeImpl("0"), new NodeImpl("1"), new NodeImpl("2") };
    NodeStore nodeStore = new NodeStore();
    Assert.assertEquals(new NodeImpl[0], nodeStore.toArray());
    nodeStore.addAll(Arrays.asList(nodes));
    Assert.assertEquals(nodes, nodeStore.toArray());
    Assert.assertEquals(nodes, nodeStore.toArray(new Node[0]));
    nodeStore.clear();
    Assert.assertEquals(new NodeImpl[0], nodeStore.toArray());
}