LayoutModelImpl extends ComponentModelImpl implements LayoutModel { @Override public LayoutModel getLayout(String path, String layoutType) { LayoutModel layout = layouts.computeIfAbsent(path, p -> new LayoutModelImpl(p, this, layoutType)); children.put(path, layout); return layout; } 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 testGetLayout() { LayoutModel layout = new LayoutModelImpl("Layout", parent, "List"); String path = "/Shuffleboard/Tab/List"; LayoutModel nested = layout.getLayout(path, "List Layout"); assertAll( () -> assertSame(nested, layout.getChild(path)), () -> assertSame(nested, layout.getChildren().get(path)) ); }