public void testRemoveBodyElement() {
XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("sample.docx");
assertEquals(3, doc.getParagraphs().size());
assertEquals(3, doc.getBodyElements().size());
XWPFParagraph p1 = doc.getParagraphs().get(0);
XWPFParagraph p2 = doc.getParagraphs().get(1);
XWPFParagraph p3 = doc.getParagraphs().get(2);
assertEquals(p1, doc.getBodyElements().get(0));
assertEquals(p1, doc.getParagraphs().get(0));
assertEquals(p2, doc.getBodyElements().get(1));
assertEquals(p2, doc.getParagraphs().get(1));
assertEquals(p3, doc.getBodyElements().get(2));
assertEquals(p3, doc.getParagraphs().get(2));
// Add another
XWPFParagraph p4 = doc.createParagraph();
assertEquals(4, doc.getParagraphs().size());
assertEquals(4, doc.getBodyElements().size());
assertEquals(p1, doc.getBodyElements().get(0));
assertEquals(p1, doc.getParagraphs().get(0));