### Question:
DefaultGroupRenderer implements GroupRenderer { @Override public Widget render(RenderMetaData metaData, String groupName, Map<String, FormItem> groupItems) { SafeHtmlBuilder builder = new SafeHtmlBuilder(); builder.appendHtmlConstant(tablePrefix); ArrayList<String> itemKeys = new ArrayList<String>(groupItems.keySet()); ArrayList<FormItem> values = new ArrayList<FormItem>(groupItems.values()); for (int i=values.size() - 1; i >= 0; i--) { if (!values.get(i).render()) { values.remove(i); itemKeys.remove(i); } } builder.appendHtmlConstant("<colgroup id='cols_"+metaData.getNumColumns()+"'>"); for(int col=0; col<metaData.getNumColumns(); col++) { builder.appendHtmlConstant("<col class='form-item-title-col'/>"); builder.appendHtmlConstant("<col class='form-item-col'/>"); } builder.appendHtmlConstant("</colgroup>"); int i=0; while(i<itemKeys.size()) { builder.appendHtmlConstant("<tr>"); int col=0; for(col=0; col<metaData.getNumColumns(); col++) { int next = i + col; if(next<itemKeys.size()) { FormItem item = values.get(next); createItemCell(metaData, builder, itemKeys.get(next), item); } else { break; } } builder.appendHtmlConstant("</tr>"); i+=col; } builder.appendHtmlConstant(tableSuffix); HTMLPanel panel = new HTMLPanel(builder.toSafeHtml()); for(String key : itemKeys) { FormItem item = groupItems.get(key); final String widgetId = id + key; final String labelId = id + key+"_l"; final String insertId = id + key+"_i"; Element input = item.getInputElement(); if(input!=null) { input.setAttribute("id", widgetId); input.setAttribute("aria-labelledby", labelId); input.setAttribute("aria-required", String.valueOf(item.isRequired())); } panel.add(item.asWidget(), insertId); } return panel; }  @Override Widget render(RenderMetaData metaData, String groupName, Map<String, FormItem> groupItems); @Override Widget renderPlain(RenderMetaData metaData, String groupName, PlainFormView plainView);  }### Answer:
@Test public void testRender() { DefaultGroupRenderer renderer = new DefaultGroupRenderer(); RenderMetaData rmd = new RenderMetaData(); rmd.setNumColumns(1); Map<String, FormItem> groupItems = new HashMap<String, FormItem>(); groupItems.put("foo", new TextBoxItem("foo", "Foo")); groupItems.put("bar", new TextBoxItem("bar", "Bar") { @Override public boolean render() { return false; } }); groupItems.put("zoo", new TextBoxItem("zoo", "Zoo") { @Override public boolean render() { return true; } }); Widget widget = renderer.render(rmd, "groupName", groupItems); HTMLPanel panel = (HTMLPanel) widget; String html = panel.getElement().getInnerHTML(); assertTrue(html.contains("Foo:")); assertTrue(html.contains("Zoo:")); assertFalse("Bar should not be rendered", html.contains("Bar:")); }