int count = 0;
List sortedKey = ((SimpleGraph) g).vertices();
Collections.sort(sortedKey);
try {
for (int i = 0; i < sortedKey.size(); i++) {
obj.clear();
obj.put("source", sortedKey.get(i));
obj.put("targets", ((SimpleGraph) g).outEdgeTargetIds(sortedKey.get(i)));
obj.writeJSONString(out);
out.append("\n");
}