@Test
public void testPostToGraph() {

    String graphId = "";
    try {
        JSONObject meta = new JSONObject();
        graphId = lg.createGraph(meta);
    }
    catch(Exception e) {
        fail("Unable to create graph in lemongraph");
    }
    try {
        UUID toUuid = UUID.fromString(graphId);
        assertEquals(toUuid.toString(), graphId);
    } catch (IllegalArgumentException e) {
        fail("Invalid graph id in testCreateGraph");
    }
    JSONObject node = new JSONObject();
    node.put("type","foo");node.put("value","bar");
    JSONObject node2 = new JSONObject();
    node2.put("type","foo");node2.put("value","baz");
    JSONArray nodes = new JSONArray();
    nodes.put(node); nodes.put(node2);
    JSONObject meta  = new JSONObject();
    JSONArray  edges = new JSONArray();
    JSONObject edge1 = new JSONObject();
    edge1.put("type","edge"); edge1.put("value","e1");
    JSONObject e1src = new JSONObject();
    e1src.put("type","foo"); e1src.put("value","bar");
    JSONObject e1tgt = new JSONObject();
    e1tgt.put("type","foo"); e1tgt.put("value","baz");
    edge1.put("src",e1src); edge1.put("tgt",e1tgt);
    edges.put(edge1);
    LemonGraphObject lgo = new LemonGraphObject(true,meta,nodes,edges);
    LemonGraphResponse lgr2 = null;
    try {
        lgr2 = lg.postToGraph(graphId, lgo);
        assertEquals(8, lgr2.getMaxId());
        assertEquals(8, lgr2.getUpdateCount());
        assertEquals(true, lgr2.didCallSucceed());
        assertEquals(204, lgr2.getResponseCode());
    }
    catch(InvalidGraphException e) {
        fail("Can't lookup graph id "+graphId);
    }
    // Delete Graph
    try {
        lg.deleteGraph(graphId);
    } catch (Exception e) {
        System.out.println("Delete failed message: " + e.getMessage());
    }
}