ArrayList<Long> list = new ArrayList<Long>();
for (int i = 0; i < path.size(); i++) {
list.add(path.get(i));
}
ListRowKey key = new ListRowKey(list);
TreeState ts = (TreeState) tree.getComponentState();
ts.setSelected(key);
ts.setSelected(null);
ts.saveState(FacesContext.getCurrentInstance());