void () { final ProjectFacetsConfigurator configurator = createConfigurator(); assertFalse(configurator.getFacetModel(myModule) instanceof ModifiableFacetModel); final ModifiableFacetModel modifiableModel = configurator.getOrCreateModifiableModel(myModule); assertSame(modifiableModel, configurator.getOrCreateModifiableModel(myModule)); assertSame(modifiableModel, configurator.getFacetModel(myModule)); assertFalse(configurator.isModified()); final MockFacet facet = createFacet(); configurator.addFacetInfo(facet); modifiableModel.addFacet(facet); assertTrue(configurator.isModified()); WriteAction.runAndWait(() -> configurator.commitFacets()); assertFalse(configurator.isModified()); final FacetModel model = configurator.getFacetModel(myModule); assertFalse(model instanceof ModifiableFacetModel); assertSame(facet, assertOneElement(model.getAllFacets())); }