@Test
public void testCount() {

    IndexImpl<Node> index = generateEmptyIndex();
    NodeImpl[] nodes = generateNodesWithUniqueAttributes(index, true);
    putAll(nodes, index);
    for (Column col : index.columnStore) {
        if (col.isIndexed()) {
            Object2IntMap<Object> counter = new Object2IntOpenHashMap();
            for (NodeImpl n : nodes) {
                Object obj = n.getAttribute(col);
                counter.put(obj, counter.getInt(obj) + 1);
            }
            for (Object2IntMap.Entry entry : counter.object2IntEntrySet()) {
                int count = entry.getIntValue();
                Object val = entry.getKey();
                Assert.assertEquals(index.count(col, val), count);
                Assert.assertEquals(index.count(col.getId(), val), count);
            }
        }
    }
}