void (final boolean removeOriginal) { final Artifact artifact = addArtifact("aaa"); final ModifiableArtifactModel model = getArtifactManager().createModifiableModel(); final ModifiableArtifact modifiable = model.getOrCreateModifiableArtifact(artifact); modifiable.setName("bbb"); model.removeArtifact(removeOriginal ? artifact : modifiable); final MyArtifactListener listener = subscribe(); commit(model); assertEmpty(getArtifacts()); assertEquals("removed:aaa;", listener.clearMessages()); }