void () { final MockFacet mockFacet = addFacet(); assertNull(getFacetManager().getFacetByType(mockFacet, MockSubFacetType.ID)); assertNull(getFacetManager().getFacetByType(mockFacet, MockFacetType.ID)); final Facet subFacet = addSubFacet(mockFacet, "sub"); assertSame(subFacet, getFacetManager().getFacetByType(mockFacet, MockSubFacetType.ID)); assertNull(getFacetManager().getFacetByType(mockFacet, MockFacetType.ID)); ModifiableFacetModel model = getFacetManager().createModifiableModel(); model.removeFacet(subFacet); commit(model); assertNull(getFacetManager().getFacetByType(MockSubFacetType.ID)); assertSame(mockFacet, getFacetManager().getFacetByType(MockFacetType.ID)); model = getFacetManager().createModifiableModel(); model.removeFacet(mockFacet); commit(model); assertNull(getFacetManager().getFacetByType(MockFacetType.ID)); }