@@ -0,0 +1,2075 @@
+package com.vaadin.tests.components.treetable;%0A%0Aimport com.vaadin.data.Item;%0Aimport com.vaadin.data.util.HierarchicalContainer;%0Aimport com.vaadin.tests.components.TestBase;%0Aimport com.vaadin.ui.Button;%0Aimport com.vaadin.ui.Button.ClickEvent;%0Aimport com.vaadin.ui.Button.ClickListener;%0Aimport com.vaadin.ui.TreeTable;%0A%0Apublic class TreeTableModifyAndSetCollapsed extends TestBase %7B%0A%0A    int counter = 1;%0A%0A    @Override%0A    protected void setup() %7B%0A        final HierarchicalContainer container = new HierarchicalContainer();%0A        container.addContainerProperty(%22value%22, String.class, %22%22);%0A%0A        final TreeTable tt = new TreeTable(null, container);%0A        tt.setSizeFull();%0A        int parentId = counter++;%0A        Item parent = container.addItem(parentId);%0A        tt.setCollapsed(parentId, false);%0A        parent.getItemProperty(%22value%22).setValue(%22parent %22 + (counter++) + %22%22);%0A        addComponent(tt);%0A        Button repopulate = new Button(%22Repopulate%22, new ClickListener() %7B%0A%0A            public void buttonClick(ClickEvent event) %7B%0A                // repopulate the container and expand root item%0A                container.removeAllItems();%0A                int parentId = counter++;%0A                Item parent = container.addItem(parentId);%0A                tt.setCollapsed(parentId, false);%0A                parent.getItemProperty(%22value%22).setValue(%0A                        %22parent %22 + (counter++) + %22%22);%0A                for (int i = 0; i %3C 4; i++) %7B%0A                    int childId = counter++;%0A                    Item child = container.addItem(childId);%0A                    child.getItemProperty(%22value%22).setValue(childId + %22%22);%0A                    container.setParent(childId, parentId);%0A                %7D%0A            %7D%0A        %7D);%0A        addComponent(repopulate);%0A    %7D%0A%0A    @Override%0A    protected String getDescription() %7B%0A        return %22Modifying a container and using setCollapsed on the same server round-trip should not cause any problems%22;%0A    %7D%0A%0A    @Override%0A    protected Integer getTicketNumber() %7B%0A        return Integer.valueOf(7785);%0A    %7D%0A%7D%0A

Test application for #7785 (adapted from ticket).