Node root = session.getRootNode();
root.addNode("test");
root.addNode("test/node1");
root.addNode("test/node2");
Page page = new Page();
page.setPath("/test/node1/page1");
page.setTitle("Page 1 Title");
ArrayList paragraphs = new ArrayList();
paragraphs.add(new Paragraph("Para 1"));
paragraphs.add(new Paragraph("Para 2"));
paragraphs.add(new Paragraph("Para 3"));
paragraphs.add(new Paragraph("Another Para "));
page.setParagraphs(paragraphs);
ocm.insert(page);
page = new Page();
page.setPath("/test/node1/page2");
page.setTitle("Page 2 Title");
paragraphs = new ArrayList();
paragraphs.add(new Paragraph("Para 1"));
paragraphs.add(new Paragraph("Para 2"));
paragraphs.add(new Paragraph("Para 5"));
paragraphs.add(new Paragraph("Another Para"));
page.setParagraphs(paragraphs);
ocm.insert(page);
page = new Page();
page.setPath("/test/node2/page1");
page.setTitle("Page 3 Title");
paragraphs = new ArrayList();
paragraphs.add(new Paragraph("Para 1"));
paragraphs.add(new Paragraph("Para 4"));
paragraphs.add(new Paragraph("Para 5"));
paragraphs.add(new Paragraph("Another Para"));
page.setParagraphs(paragraphs);
ocm.insert( page);
page = new Page();
page.setPath("/test/node2/page2");
page.setTitle("Page 4 Title");
paragraphs = new ArrayList();
paragraphs.add(new Paragraph("Para 6"));
paragraphs.add(new Paragraph("Para 7"));
paragraphs.add(new Paragraph("Para 8"));
paragraphs.add(new Paragraph("Another Para"));
page.setParagraphs(paragraphs);
ocm.insert(page);
ocm.save();