protected void collapsed(CollapseEvent event) { Object item = event.getItemId(); table.setItemIcon(item, Icons.FOLDER_CLOSED); Collection<?> children = table.getChildren(item); if (children != null) { for (Object object : new HashSet<>(children)) { table.removeItem(object); } } }