CellSelection extends TextSelection { public Cell getCell() { return mCell; } CellSelection(Navigation search, String text, OdfElement containerElement,
			int index, Cell cell); void advancedReplaceWith(String newText, CellValueAdapter adapter); void advancedReplaceWith(String newText); Cell getCell();  }
@Test public void testReplaceWith() { Map<String, String> valueProperties = new HashMap<String, String>(); valueProperties.put("Amount", "3,000,000"); valueProperties.put("Task", "Develop\nWith a second line"); valueProperties.put("Date", "11/09/2010"); valueProperties.put("Time", "14:30"); valueProperties.put("Status", "true"); for (String key : valueProperties.keySet()) { String value = valueProperties.get(key); TextNavigation navigate = new TextNavigation(key, doc); while (navigate.hasNext()) { CellSelection selection = (CellSelection) navigate.nextSelection(); try { selection.replaceWith(value); String newValue = selection.getCell().getStringValue(); Assert.assertEquals(valueProperties.get(key), newValue); } catch (InvalidNavigationException e) { e.printStackTrace(); } } } }