class AbstractComposite<T extends Container> extends AbstractComponent<T> implements Composite, Container {
    
    private Component component;

    /**
     * Default constructor
     */
    public AbstractComposite() {
        component = null;
    }
    
    @Override
    public void setComponent(Component component) {<FILL_FUNCTION_BODY>}

    @Override
    public Component getComponent() {
        return component;
    }

    @Override
    public int getChildCount() {
        return component != null ? 1 : 0;
    }

    @Override
    public List<Component> getChildrenList() {
        if(component != null) {
            return Collections.singletonList(component);
        }
        else {
            return Collections.emptyList();
        }
    }

    @Override
    public Collection<Component> getChildren() {
        return getChildrenList();
    }

    @Override
    public boolean containsComponent(Component component) {
        return component != null && component.hasParent(this);
    }

    @Override
    public boolean removeComponent(Component component) {
        if(this.component == component) {
            this.component = null;
            component.onRemoved(this);
            invalidate();
            return true;
        }
        return false;
    }

    @Override
    public boolean isInvalid() {
        return component != null && component.isInvalid();
    }

    @Override
    public void invalidate() {
        super.invalidate();

        //Propagate
        if(component != null) {
            component.invalidate();
        }
    }

    @Override
    public Interactable nextFocus(Interactable fromThis) {
        if(fromThis == null && getComponent() instanceof Interactable) {
            Interactable interactable = (Interactable) getComponent();
            if(interactable.isEnabled()) {
                return interactable;
            }
        }
        else if(getComponent() instanceof Container) {
            return ((Container)getComponent()).nextFocus(fromThis);
        }
        return null;
    }

    @Override
    public Interactable previousFocus(Interactable fromThis) {
        if(fromThis == null && getComponent() instanceof Interactable) {
            Interactable interactable = (Interactable) getComponent();
            if(interactable.isEnabled()) {
                return interactable;
            }
        }
        else if(getComponent() instanceof Container) {
            return ((Container)getComponent()).previousFocus(fromThis);
        }
        return null;
    }

    @Override
    public boolean handleInput(KeyStroke key) {
        return false;
    }

    @Override
    public void updateLookupMap(InteractableLookupMap interactableLookupMap) {
        if(getComponent() instanceof Container) {
            ((Container)getComponent()).updateLookupMap(interactableLookupMap);
        }
        else if(getComponent() instanceof Interactable) {
            interactableLookupMap.add((Interactable)getComponent());
        }
    }
}

        Component oldComponent = this.component;
        if(oldComponent == component) {
            return;
        }
        if(oldComponent != null) {
            removeComponent(oldComponent);
        }
        if (component != null) {
            this.component = component;
            component.onAdded(this);
            if (getBasePane() != null) {
                MenuBar menuBar = getBasePane().getMenuBar();
                if (menuBar == null || menuBar.isEmptyMenuBar()) {
                    component.setPosition(TerminalPosition.TOP_LEFT_CORNER);
                } else {
                    component.setPosition(TerminalPosition.TOP_LEFT_CORNER.withRelativeRow(1));
                }
            }
            invalidate();
        }
    
<methods>public void <init>() ,public synchronized T addTo(com.googlecode.lanterna.gui2.Panel) ,public final synchronized void draw(com.googlecode.lanterna.gui2.TextGUIGraphics) ,public com.googlecode.lanterna.gui2.BasePane getBasePane() ,public com.googlecode.lanterna.TerminalPosition getGlobalPosition() ,public com.googlecode.lanterna.gui2.LayoutData getLayoutData() ,public com.googlecode.lanterna.gui2.Container getParent() ,public com.googlecode.lanterna.TerminalPosition getPosition() ,public final com.googlecode.lanterna.TerminalSize getPreferredSize() ,public synchronized ComponentRenderer<T> getRenderer() ,public com.googlecode.lanterna.TerminalSize getSize() ,public com.googlecode.lanterna.gui2.TextGUI getTextGUI() ,public synchronized com.googlecode.lanterna.graphics.Theme getTheme() ,public com.googlecode.lanterna.graphics.ThemeDefinition getThemeDefinition() ,public boolean hasParent(com.googlecode.lanterna.gui2.Container) ,public void invalidate() ,public boolean isInside(com.googlecode.lanterna.gui2.Container) ,public boolean isInvalid() ,public boolean isVisible() ,public synchronized void onAdded(com.googlecode.lanterna.gui2.Container) ,public synchronized void onRemoved(com.googlecode.lanterna.gui2.Container) ,public synchronized T setLayoutData(com.googlecode.lanterna.gui2.LayoutData) ,public synchronized T setPosition(com.googlecode.lanterna.TerminalPosition) ,public final synchronized T setPreferredSize(com.googlecode.lanterna.TerminalSize) ,public T setRenderer(ComponentRenderer<T>) ,public synchronized T setSize(com.googlecode.lanterna.TerminalSize) ,public synchronized com.googlecode.lanterna.gui2.Component setTheme(com.googlecode.lanterna.graphics.Theme) ,public T setVisible(boolean) ,public com.googlecode.lanterna.TerminalPosition toBasePane(com.googlecode.lanterna.TerminalPosition) ,public com.googlecode.lanterna.TerminalPosition toGlobal(com.googlecode.lanterna.TerminalPosition) ,public synchronized com.googlecode.lanterna.gui2.Border withBorder(com.googlecode.lanterna.gui2.Border) <variables>private ComponentRenderer<T> defaultRenderer,private com.googlecode.lanterna.TerminalSize explicitPreferredSize,private boolean invalid,private com.googlecode.lanterna.gui2.LayoutData layoutData,private ComponentRenderer<T> overrideRenderer,private com.googlecode.lanterna.gui2.Container parent,private com.googlecode.lanterna.TerminalPosition position,private com.googlecode.lanterna.TerminalSize size,private com.googlecode.lanterna.graphics.Theme themeOverride,private ComponentRenderer<T> themeRenderer,private com.googlecode.lanterna.graphics.Theme themeRenderersTheme,private boolean visible