private static IList <IDictionary <string, object> > NodeCounts(TokenRead tokens, Read read, Anonymizer anonymizer) { IList <IDictionary <string, object> > nodeCounts = new List <IDictionary <string, object> >(); IDictionary <string, object> nodeCount = new Dictionary <string, object>(); nodeCount["count"] = read.CountsForNodeWithoutTxState(-1); nodeCounts.Add(nodeCount); tokens.LabelsGetAllTokens().forEachRemaining(t => { long count = read.CountsForNodeWithoutTxState(t.id()); IDictionary <string, object> labelCount = new Dictionary <string, object>(); labelCount.put("label", anonymizer.Label(t.name(), t.id())); labelCount.put("count", count); nodeCounts.Add(labelCount); }); return(nodeCounts); }