void (final LwComponent component) { if (component == null) { throw new IllegalArgumentException("component cannot be null"); } if (myComponents.contains(component)) { throw new IllegalArgumentException("component is already added: " + component); } if (component.getParent() != null) { throw new IllegalArgumentException("component already added to another container"); } // Attach to new parent myComponents.add(component); component.setParent(this); }