Code example for ArrayList

Methods: add

0
        OpenGraphAction action = OpenGraphAction.Factory.createForPost();
 
        GraphObject tag = GraphObject.Factory.create();
        tag.setProperty("id", "123");
 
        List<GraphObject> tags = new ArrayList<GraphObject>();
        tags.add(tag);
 
        action.setTags(tags);
 
        GraphObjectList<GraphObject> retrievedTags = action.getTags();
        assertNotNull(retrievedTags);
        assertEquals(1, retrievedTags.size());
        assertEquals("123", retrievedTags.get(0).getProperty("id"));
    } 
}