newSubNode.setData("Sample sub node");
tree.addNode(facesContext, rowKey, newSubNode, new Integer(1), null);
tree.setRowKey(null);
TreeState state = new TreeState();
try {
state.expandAll(tree);
} catch (Exception e) {
System.out.println("testManipulateState expandAll failed");
fail();
}
tree.setRowKey(rowKey);
assertTrue(state.isExpanded(rowKey));
TreeState oldState = (TreeState)state.getSubState(rowKey);
state.clearSubState(rowKey);
assertTrue(!state.isExpanded(rowKey));
state.mergeSubState(rowKey, oldState);
assertTrue(state.isExpanded(rowKey));
}