//new clean instance of paragraph
XWPFDocument doc = new XWPFDocument();
XWPFParagraph p = doc.createParagraph();
CTP ctp = p.getCTP();
CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();
CTTextAlignment txtAlign = ppr.addNewTextAlignment();
txtAlign.setVal(STTextAlignment.CENTER);
assertEquals(TextAlignment.CENTER, p.getVerticalAlignment());
p.setVerticalAlignment(TextAlignment.BOTTOM);
assertEquals(STTextAlignment.BOTTOM, ppr.getTextAlignment().getVal());
}