while (search.hasNext()) {
TextSelection item = (TextSelection) search.nextSelection();
table = sourcedoc.getTableByName("Table1");
Cell cell = table.getCellByPosition(0, 0);
cell.setStringValue("SIMPLE");
Table newtable = item.replaceWith(table);
Assert.assertNotNull(newtable);
Assert.assertEquals(1, newtable.getHeaderColumnCount());
Assert.assertEquals(1, newtable.getHeaderRowCount());
Assert.assertEquals(7 + 1, newtable.getRowCount());
Assert.assertEquals(5 + 1, newtable.getColumnCount());