Component extends AbstractType implements Serializable { public void associateFacet( Facet facet ) { this.facets.add( facet ); facet.associatedComponents.add( this ); } Component();  Component( String name ); String getInstallerName(); void setInstallerName( String installerName ); Component getExtendedComponent(); Collection<Component> getExtendingComponents(); Collection<Facet> getFacets(); Component name( String name ); Component installerName( String installerName ); void extendComponent( Component component ); void associateFacet( Facet facet ); void disassociateFacet( Facet facet ); void addImportedVariable( ImportedVariable var ); final Map<String,ImportedVariable> importedVariables; }
@Test public void testAssociateFacet() { Component component = new Component( "comp" ); Facet facet = new Facet( "facet" ); Assert.assertEquals( 0, component.getFacets().size()); Assert.assertEquals( 0, facet.getAssociatedComponents().size()); component.associateFacet( facet ); Assert.assertEquals( 1, component.getFacets().size()); Assert.assertEquals( 1, facet.getAssociatedComponents().size()); Assert.assertEquals( facet, component.getFacets().iterator().next()); Assert.assertEquals( component, facet.getAssociatedComponents().iterator().next()); }