LayoutModelImpl extends ComponentModelImpl implements LayoutModel { @Override public void addChild(ComponentModel component) { children.put(component.getPath(), component); } LayoutModelImpl(String path, ParentModel parent, String displayType);   LayoutModelImpl(String path, ParentModel parent, String displayType, Map<String, Object> properties); @Override LayoutModel getLayout(String path, String layoutType); @Override ComponentModel getChild(String path); @Override void addChild(ComponentModel component); @Override Map<String, ComponentModel> getChildren();  }
@Test public void testAddChild() { LayoutModel layout = new LayoutModelImpl("Layout", parent, "List"); String path = "/Shuffleboard/Tab/Foo"; ComponentModel child = new WidgetModelImpl(path, layout, () -> null, "", Collections.emptyMap()); layout.addChild(child); assertSame(child, layout.getChild(path)); }