DefaultGridLayer extends Layer implements GridLayer,
                                                       GridWidgetRegistry { @Override public void register(final GridWidget gridWidget) { registeredGridWidgets.add(gridWidget); } DefaultGridLayer(); @Override void onNodeMouseDown(final NodeMouseDownEvent event); @Override void onNodeMouseMove(final NodeMouseMoveEvent event); @Override void onNodeMouseUp(final NodeMouseUpEvent event); @Override Layer draw(); @Override Layer batch(); @Override Layer batch(final GridLayerRedrawManager.PrioritizedCommand command); @Override Set<IPrimitive<?>> getGridWidgetConnectors(); @Override Layer add(final IPrimitive<?> child); @Override void register(final GridWidget gridWidget); @Override void refreshGridWidgetConnectors(); @Override Layer add(final IPrimitive<?> child,
                     final IPrimitive<?>... children); @Override Layer remove(final IPrimitive<?> child); @Override void deregister(final GridWidget gridWidget); @Override Layer removeAll(); @Override void select(final GridWidget selectedGridWidget); @Override void selectLinkedColumn(final GridColumn<?> selectedGridColumn); @Override void flipToGridWidget(final GridWidget gridWidget); @Override void scrollToGridWidget(final GridWidget gridWidget); @Override Set<GridWidget> getGridWidgets(); @Override void enterPinnedMode(final GridWidget gridWidget,
                                final Command onStartCommand); @Override void exitPinnedMode(final Command onCompleteCommand); @Override void updatePinnedContext(final GridWidget gridWidget); @Override PinnedContext getPinnedContext(); @Override boolean isGridPinned(); @Override TransformMediator getDefaultTransformMediator(); @Override void addOnEnterPinnedModeCommand(final Command command); @Override void addOnExitPinnedModeCommand(final Command command); @Override Bounds getVisibleBounds(); @Override GridWidgetDnDHandlersState getGridWidgetHandlersState(); @Override AbsolutePanel getDomElementContainer(); @Override void setDomElementContainer(final AbsolutePanel domElementContainer);  }
@Test public void testRegister() { final GridWidget gridWidget1 = mock(GridWidget.class); final GridWidget gridWidget2 = mock(GridWidget.class); gridLayer.register(gridWidget1); assertThat(gridLayer.getGridWidgets().size()).isEqualTo(1); assertThat(gridLayer.getGridWidgets()).contains(gridWidget1); gridLayer.register(gridWidget2); assertThat(gridLayer.getGridWidgets().size()).isEqualTo(2); assertThat(gridLayer.getGridWidgets()).contains(gridWidget1, gridWidget2); }